
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
None | size: 0.80 KB | hits: 12 | expires: Never
How can i set value of style with ConfigurationFile?
<applicationSettings>
<TestApp.Properties.Settings>
<setting name="ButtonBackground" serializeAs="String">
<value>#FF008000</value>
</setting>
</TestApp.Properties.Settings>
</applicationSettings>
<Application x:Class="TestApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:p="clr-namespace:TestApp.Properties"
StartupUri="MainWindow.xaml">
<Application.Resources>
<Style TargetType="Button">
<Setter Property="Background" Value="{Binding Source={x:Static p:Settings.Default}, Path=ButtonBackground}"/>
</Style>
</Application.Resources>
</Application>