Windows Phone上的F#报价 [英] F# quotations on Windows Phone
本文介绍了Windows Phone上的F#报价的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Windows手机上使用Daniel Mohl的F#模板,但是似乎捆绑的FSharp.Core没有一些引号代码.我正在尝试从常规.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))
但是编译器抱怨Microsoft.FSharp.Quotations.Patterns和PropertyGet.似乎它甚至都不知道Expr类型. 关于如何解决这个问题有什么想法吗?
解决方案
我用 But the compiler complaints about Microsoft.FSharp.Quotations.Patterns and PropertyGet. It seems it doesn't even know the Expr type.
Any idea on how to solve this? I replaced the FSharp.Core file that comes in the template by the one that comes in the F# April 2011 CTP in the WindowsPhone7\Silverlight\4.0\bin folder, and with this version it now compiles fine 这篇关于Windows Phone上的F#报价的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! 解决方案
查看全文