1
是否可以從UserControl
本身訪問已定義的資源?怎麼樣?從自己訪問UserControl的資源
我試圖做到這一點:
<UserControl xmlns="all defined namespaces here..."
Visibility="{Binding Show,FallbackValue=Hidden,
Converter={StaticResource BooleanToVisibility}}">
<UserControl.Resources>
<ResourceDictionary>
<BooleanToVisibilityConverter x:Key="BooleanToVisibility" />
</ResourceDictionary>
</UserControl.Resources>
</UserControl>
,但我得到這個錯誤:
'Provide value on 'System.Windows.StaticResourceExtension' threw an exception.' Line number '11' and line position '9'.
我是多麼醉心:D非常感謝。完美的想法 –