Friday, July 31, 2009

WPF Binding Textbox.Text to App Settings


Add a namespace in the XAML to your WPF Form to reference the settings

xmlns:settings="clr-namespace:ApplicationName.Properties">



To bind an application setting to a textbox use:

Text="{Binding Source={x:Static settings:Settings.Default}, Path=myText, Mode=TwoWay}"



Set the "Path" value to your setting name and now you can use the app settings interface the same as before with windows forms.


No comments:

Post a Comment