Hey guys,
I am trying to use a RadComboBox to bind to a Specialized.StringCollection in my User.Settings. I am able to load the ComboBox from the collection, but the twoway binding does not seem to work. Is this possible with just stright XAML binding or do I need to create a whole class to accomodate this? I have the twoway binding working for my Window properties so I do know that I appear to have my ResourceDictionary configured correctly. Below is what I have so far.
XAML
App.Config
ResourceDictionary (registered in App.Xaml)
I am trying to use a RadComboBox to bind to a Specialized.StringCollection in my User.Settings. I am able to load the ComboBox from the collection, but the twoway binding does not seem to work. Is this possible with just stright XAML binding or do I need to create a whole class to accomodate this? I have the twoway binding working for my Window properties so I do know that I appear to have my ResourceDictionary configured correctly. Below is what I have so far.
XAML
| <telerikInput:RadComboBox x:Name="comboTheme" ItemsSource="{Binding Source={StaticResource settings}, Path=Default.Theme}" |
| SelectedItem="{Binding Default.Theme, Mode=TwoWay}"/> |
App.Config
| <userSettings> |
| <EliteExtender.Shell.Properties.Settings> |
| <setting name="MainWidth" serializeAs="String"> |
| <value>800</value> |
| </setting> |
| <setting name="MainHeight" serializeAs="String"> |
| <value>625</value> |
| </setting> |
| <setting name="MainState" serializeAs="String"> |
| <value /> |
| </setting> |
| <setting name="Theme" serializeAs="Xml"> |
| <value> |
| <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
| <string>Office_Blue</string> |
| <string>Office_Black</string> |
| <string>Office_Silver</string> |
| <string>Summer</string> |
| <string>Vista</string> |
| <string>Windows7</string> |
| </ArrayOfString> |
| </value> |
| </setting> |
| </EliteExtender.Shell.Properties.Settings> |
| </userSettings> |
ResourceDictionary (registered in App.Xaml)
| <ResourceDictionary |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:settings="clr-namespace:EliteExtender.Shell.Properties"> |
| <ResourceDictionary.MergedDictionaries> |
| <ResourceDictionary> |
| <settings:Settings x:Key="settings" /> |
| </ResourceDictionary> |
| </ResourceDictionary.MergedDictionaries> |
| </ResourceDictionary> |