In the settings for my project I have a StringCollection. I'm trying to bind it to a listbox in one of my settings menus to let the user change the values.
I have no problem bind the actual resource to make the string populate the box, but apparently StringCollection doesn't support the appropriate notifications for two way binding. So, I've give the settings window an ObservableCollection<string> member, copy the contents over on open & close, etc. But I can't seem to figure out how to get that data member to work in binding... all the examples I can find seem to be for static data...
Edit: Just to be clear, I need something like this:
CS
XAML
I have no problem bind the actual resource to make the string populate the box, but apparently StringCollection doesn't support the appropriate notifications for two way binding. So, I've give the settings window an ObservableCollection<string> member, copy the contents over on open & close, etc. But I can't seem to figure out how to get that data member to work in binding... all the examples I can find seem to be for static data...
Edit: Just to be clear, I need something like this:
CS
Code:
public partial class MyWindow : Window
{
private ObservableCollection<string> mystrings;
...
}
XAML
Code:
<Window x:Class="MyWindow"
...
<ListBox ItemsSource="{Binding ??? what here ???, Mode="TwoWay"}"/>
</Window>
Last edited:
