I found this. Checking out, hope I am not wasting my time...
http://code.msdn.microsoft.com/StaticExExtension
If you have any better ideas, please lemme know.
Shimmy
2010-04-22 04:31:02
I found this. Checking out, hope I am not wasting my time...
http://code.msdn.microsoft.com/StaticExExtension
If you have any better ideas, please lemme know.
I've always done it using the x:Static Markup Extension. The key is to set the source to Settings.Default
and the path to the desired setting like so:
<Window x:Class="SettingsBindSample.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:SettingsBindSample.Properties"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<CollectionViewSource x:Key="MyItems"
Source="{Binding MyCollection, Source={x:Static s:MySettings.Default}}" />
</Window.Resources>
<StackPanel>
<ComboBox ItemsSource="{Binding Source={StaticResource MyItems}}" />
</StackPanel>
</Window>