Skip to content

Commit

Permalink
FlipView: Bind ItemStringFormat to ContentStringFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Aug 31, 2017
1 parent 9f75954 commit edc3467
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,40 +124,37 @@
Grid.Row="0"
Grid.Column="0"
Margin="5 2"
Content="Banner" />
Content="Banner"
IsChecked="{Binding ElementName=FlipView1st, Path=IsBannerEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<CheckBox x:Name="ShowMouseOverCheckBox"
Grid.Row="0"
Grid.Column="1"
Margin="5 2"
Content="MouseOver Glow"
IsChecked="True" />
IsChecked="{Binding ElementName=FlipView1st, Path=MouseOverGlowEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<CheckBox x:Name="CircularNaviCheckBox"
Grid.Row="1"
Grid.Column="0"
Margin="5 2"
Content="Circular Navi"
IsChecked="False" />
IsChecked="{Binding ElementName=FlipView1st, Path=CircularNavigation, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<CheckBox x:Name="ShowNaviCheckBox"
Grid.Row="1"
Grid.Column="1"
Margin="5 2"
Content="Show NaviButtons"
IsChecked="True" />
IsChecked="{Binding ElementName=FlipView1st, Path=IsNavigationEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<ComboBox x:Name="Orientation"
Grid.Row="2"
Grid.Column="0"
Grid.ColumnSpan="2"
ItemsSource="{Binding Source={mx:EnumBindingSource {x:Type Orientation}}, Mode=OneTime}"
SelectedIndex="0" />
SelectedValue="{Binding ElementName=FlipView1st, Path=Orientation, FallbackValue=Horizontal, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
<Controls:FlipView x:Name="FlipView1st"
Height="200"
Margin="0 0 5 0"
CircularNavigation="{Binding ElementName=CircularNaviCheckBox, Path=IsChecked, Mode=OneWay}"
IsBannerEnabled="{Binding ElementName=ShowBannerCheckBox, Path=IsChecked, Mode=OneWay}"
IsNavigationEnabled="{Binding ElementName=ShowNaviCheckBox, Path=IsChecked, Mode=OneWay}"
MouseOverGlowEnabled="{Binding ElementName=ShowMouseOverCheckBox, Path=IsChecked, Mode=OneWay}"
Orientation="{Binding ElementName=Orientation, Path=SelectedValue, Mode=OneWay}"
Foreground="{DynamicResource WhiteBrush}"
SelectionChanged="FlipView_SelectionChanged">
<Controls:FlipView.Items>
<Grid Background="#2E8DEF">
Expand Down
1 change: 1 addition & 0 deletions src/MahApps.Metro/MahApps.Metro/Themes/FlipView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
Content="{TemplateBinding SelectedItem}"
ContentTemplate="{TemplateBinding ItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
ContentStringFormat="{TemplateBinding ItemStringFormat}"
IsTabStop="False" />
</Grid>
</Border>
Expand Down

0 comments on commit edc3467

Please sign in to comment.