Binding and style doesn't work for Win8?

十年热恋 提交于 2019-12-01 13:24:36

Binding in Style Setters is not supported in WinRT.

<Grid.Resources>
        <ResourceDictionary>
            <Style TargetType="a:MyTextBox">
                <Setter Property="Background" Value="{StaticResource MyBackground}"></Setter>
                <Setter Property="BorderBrush" Value="{StaticResource MyBorder}"></Setter>
                <Setter Property="Width" Value="200"></Setter>
                <Setter Property="IsReadOnly" Value="False"></Setter>
                <Setter  Property="BorderBrush" Value="3"></Setter>
            </Style>
        </ResourceDictionary>
    </Grid.Resources>

Try this

And inside App.xaml do <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Common/StandardStyles.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary>

And create a file called standard styles inside your common dir and declare your brushes there (you can actually declare everything there

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!