Sunday, March 25, 2012

Accessing App.Config Properties From XAML


How to access user settings stored in app.config file from XAML?

Accessing app.config from XAML


First we need to add reference to Properties in our XAML file.
And this is how we use it:
<TextBox Name="serverNameTextBox" 
         Grid.Column="1" Grid.Row="0"
         Text="{Binding Source={x:Static p:Settings.Default}, 
                                Path=ServerName, Mode=OneWay}">
Hope it will save your time.

No comments:

Post a Comment