Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 0.80 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How can i set value of style with ConfigurationFile?
  2. <applicationSettings>
  3.     <TestApp.Properties.Settings>
  4.         <setting name="ButtonBackground" serializeAs="String">
  5.             <value>#FF008000</value>
  6.         </setting>
  7.     </TestApp.Properties.Settings>
  8. </applicationSettings>
  9.        
  10. <Application x:Class="TestApp.App"
  11.              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  12.              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  13.              xmlns:p="clr-namespace:TestApp.Properties"
  14.              StartupUri="MainWindow.xaml">
  15.     <Application.Resources>
  16.         <Style TargetType="Button">
  17.             <Setter Property="Background" Value="{Binding Source={x:Static p:Settings.Default}, Path=ButtonBackground}"/>
  18.         </Style>
  19.     </Application.Resources>
  20. </Application>