I use Daniel Mohl F # templates for a Windows phone, but there seems to be no quote code in the FSharp.Core bundle. I am trying to port this code from regular .NET:
open System.ComponentModel
open Microsoft.FSharp.Quotations
open Microsoft.FSharp.Quotations.Patterns
[<AbstractClass>]
type ViewModelBase() =
let propertyChanged = new Event<_, _>()
let toPropName expr =
match expr with
| PropertyGet(a, b, list) -> b.Name
| _ -> failwith "Unsupported: " + expr.ToString()
interface INotifyPropertyChanged with
[<CLIEvent>]
member x.PropertyChanged = propertyChanged.Publish
member x.NotityPropertyChanged expr =
propertyChanged.Trigger(x, new PropertyChangedEventArgs(toPropName expr))
But the compiler complains about Microsoft.FSharp.Quotations.Patterns and PropertyGet. He doesn't seem to even know the type of Expr. Any idea on how to solve this?
source
share