This is my xaml:
SelectedItem="{Binding Source={StaticResource Settings}, Path=Default.Selected, Converter={StaticResource SelectedTabConverter}}"
I added Console.WriteLine() in Convert() and ConvertBack() so I could see that they were doing what they were supposed to do. However, when I checked my setting before saving it in my OnExit(), I saw that the setting was not changed. I thought this binding was two-way and I changed anything to the UI should change the setting at the same time. Any idea?
First, it’s hard to tell what your problem is without reading your previous question.
You have created a Settings object as a resource in your App’s ResourceDictionary. There’s no need to do that. Just bind to the static
Settings.Defaultobject like shown below (and correctly shown in the answer to your other question).where the XML namespace
propertiesreferences thePropertiesnamespace of your application.Aside from that you should bind to the SelectedIndex property instead of SelectedItem. That way you would not need a converter at all.
See also this question.