Something like this?

1
2
3
4
5
6
7
type MyCommand () =
    let cecEvent = new DelegateEvent<System.EventHandler>()
    interface System.Windows.Input.ICommand with
        [<CLIEvent>]
        member this.CanExecuteChanged = cecEvent.Publish
        member this.CanExecute arg = true
        member this.Execute arg = ()

See: [link:msdn.microsoft.com]

By on 4/9/2010 4:45 AM ()

cant format code :(

By on 4/9/2010 6:00 AM ()
By on 4/9/2010 7:07 AM ()

cant format code ....??

By on 4/9/2010 5:47 AM ()

Wow - thats great !!! - Thanks

I was soo close

type FuncCommand() =

let evt = new Event<EventHandler,EventArgs>()

interface ICommand with

override x.CanExecute(o:Object) = true

override x.Execute(o:Object) = ()

[<CLIEvent>]

member x.CanExecuteChanged = evt.Publish

By on 4/9/2010 5:45 AM ()

Ahh - got my HubFs editor working (was not in compatibily mode in IE8)

This is where I got to (see below) - I wasnt far off, but thanks for a perfect solution

1
2
3
4
5
6
7
8
9
10
 

type FuncCommand() = 
    let evt = new Event<EventHandler,EventArgs>()
    interface ICommand with
        override x.CanExecute(o:Object) = true
        override x.Execute(o:Object) = ()
    [<CLIEvent>]
    member x.CanExecuteChanged = evt.Publish
By on 4/9/2010 11:14 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper