I have an ObservableCollection of SettingsModel has a string and bool. Now i'm making settings page, with listbox of switches.
<Grid>
<ListBox
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Margin="0,0,0,0"
ItemsSource="{Binding Path=SettingsItems, Mode=TwoWay}"
ItemContainerStyle="{StaticResource ListBoxItemsStrerchedStyle}" >
<ListBox.ItemTemplate>
<DataTemplate>
<toolkit:ToggleSwitch
Header="{Binding kind}"
Content="{Binding value}"
IsChecked="{Binding value, Mode=TwoWay}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
The problem is that when user changes state of the switch, it is not rising notification (Content is not changed). Moreover, if to scroll down through the list (about 30 items) and then scroll up, some of the switches are changing their state.
Should i use ObservableDictionary (which is looking quite obsolete), or make SettingsModel throw notification somehow?