Click here to Skip to main content
15,883,458 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am trying to perform some simple binding in a Windows Store app. Some controls e.g. ToggleButton bind fine, but when a Slider is bound, changes in the UI are not reflected in the bound object.

The data source is an ObservableCollection<Film>. Film has some properties including:
public bool Seen { get; set; } // Actually INotifyPropertyChanged is implemented
public int Rating { get; set; } // on both.

The XAML is like (simplified for clarity):
<Page DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}">
    <FlipView DataContext="{Binding Group}" ItemsSource="{Binding Source={StaticResource itemsViewSource}}">
                    <ToggleButton Content="Seen It" IsChecked="{Binding Seen, Mode=TwoWay}"> 
                    <Slider Value="{Binding Rating, Mode=TwoWay}" IsEnabled="{Binding Seen}" Etc="the usual properties set here.">

When the user interacts with the ToggleButton, the Film's Seen property is updated. The Rating property never changes. I have to manually updated the business object in code behind.

I have been googling all day. I couldn't find other examples of binding Slider.Value. Everyone is interested in binding it to the value of a TextBox.
Updated 8-Jun-14 9:52am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900