我試圖解決一個問題,突然這樣的:設置ConverterCulture用x:靜態
有什麼不對?它是可編譯的,似乎在運行時沒有問題。重新啓動VS並沒有幫助,xaml設計者總是說「無效的標記」。
的XAML:
<Window x:Class="WpfApplication1.MainWindow"
...
xmlns:SystemGlobalization="clr-namespace:System.Globalization;assembly=mscorlib">
<TextBlock Text="{Binding Test, ConverterCulture={x:Static SystemGlobalization:CultureInfo.CurrentCulture}}" />
</Window>
編譯器錯誤:
The member "CurrentCulture" is not recognized or is not accessible.
更多的細節:
- VS 2015年
- .Net框架4.5
請看到帖子: http://stackoverflow.com/questions/27477598/the-member-currentculture-is-not-recognized-or-is-not-accessible – MarPreSI
廠對於我來說,在VS2010或VS2013中沒有錯誤 –
@MartinPrediger,感謝您找到重複,但它沒有可接受的解決方案,並且沒有任何答案有幫助,例如我必須定位'4.5',並且由於[issue](http://stackoverflow.com/q/37182987/1997232),我試圖從早期的自定義綁定切換到xaml。 – Sinatr