|
6 | 6 | xmlns:local="clr-namespace:View" |
7 | 7 | xmlns:vm="clr-namespace:ViewModel;assembly=ViewModel" |
8 | 8 | xmlns:vmc="clr-namespace:ViewModel.Commands;assembly=ViewModel" |
| 9 | + xmlns:converters="clr-namespace:View.Converters" |
9 | 10 | mc:Ignorable="d" |
10 | 11 | Style="{StaticResource {x:Type Window}}" |
11 | 12 | Title="Stugether" Height="450" Width="800"> |
|
21 | 22 | <RowDefinition Height="35"/> |
22 | 23 | <RowDefinition Height="1*"/> |
23 | 24 | </Grid.RowDefinitions> |
24 | | - <Grid Height="{Binding ActualHeight, ElementName=tbContentTitle, Mode=OneWay}"> |
| 25 | + <Grid Height="{Binding ActualHeight, ElementName=tbContentTitle, Mode=OneWay}" Background="{StaticResource BackgroundSecundary}"> |
25 | 26 | <Grid.ColumnDefinitions> |
26 | 27 | <ColumnDefinition Width="1*" /> |
27 | 28 | <ColumnDefinition Width="1*" /> |
28 | 29 | </Grid.ColumnDefinitions> |
29 | | - <Button x:Name="btPreviousButton" Content="<" Margin="5,5,5,5" Click="NavigationNextPreviousButton_Click"/> |
30 | | - <Button x:Name="btNextButton" Content=">" Grid.Column="1" Margin="5" Click="NavigationNextPreviousButton_Click"/> |
| 30 | + <Button x:Name="btPreviousButton" Margin="5,5,5,5" Command="NavigationCommands.BrowseBack" CommandTarget="{Binding ElementName=frContent}"> |
| 31 | + <Path Margin="0,0,2,0" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 4 0 L 0 4 L 4 8 Z" Fill="#FF444444"/> |
| 32 | + </Button> |
| 33 | + <Button x:Name="btNextButton" Grid.Column="1" Margin="5" Command="NavigationCommands.BrowseForward" CommandTarget="{Binding ElementName=frContent}"> |
| 34 | + <Path Margin="0,0,2,0" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 4 4 L 0 8 Z" Fill="#FF444444"/> |
| 35 | + </Button> |
31 | 36 | </Grid> |
32 | 37 | <!-- The Stackpanel doesn't allow a binding for its children, so we use a ItemsControl instead --> |
33 | | - <StackPanel Grid.Row="1"> <!-- TEMPORARY for login button --> |
34 | 38 | <ItemsControl x:Name="icMenuItems" Grid.Row="1" ItemsSource="{Binding MainNavigationItems}"> |
35 | 39 | <ItemsControl.ItemsPanel> |
36 | 40 | <ItemsPanelTemplate> |
|
39 | 43 | </ItemsControl.ItemsPanel> |
40 | 44 | <ItemsControl.ItemTemplate> |
41 | 45 | <ItemContainerTemplate> |
42 | | - <local:MainWindowNavigationItem Content="{Binding Title}" Page="{Binding Page}" ExtraNavigationInformation="{Binding ExtraInformation}" Command="{Binding Path=DataContext.NavigateButtonCommand, RelativeSource={RelativeSource AncestorType=Window},Mode=Default}" CommandParameter="{Binding Mode=OneWay}"/> |
| 46 | + <local:MainWindowNavigationItem |
| 47 | + Content="{Binding Title}" Page="{Binding Page}" ExtraNavigationInformation="{Binding ExtraInformation}" |
| 48 | + Command="{Binding Path=DataContext.NavigateButtonCommand, RelativeSource={RelativeSource AncestorType=Window},Mode=Default}" CommandParameter="{Binding Mode=OneWay}"> |
| 49 | + <local:MainWindowNavigationItem.IsChecked> |
| 50 | + <MultiBinding Mode="OneWay"> |
| 51 | + <MultiBinding.Converter> |
| 52 | + <converters:MultiPageEqualsConverter/> |
| 53 | + </MultiBinding.Converter> |
| 54 | + <Binding Path="Page" Mode="OneWay"/> |
| 55 | + <Binding Path="DataContext.CurrentVisiblePage" RelativeSource="{RelativeSource AncestorType=Window}" Mode="OneWay"/> |
| 56 | + </MultiBinding> |
| 57 | + </local:MainWindowNavigationItem.IsChecked> |
| 58 | + </local:MainWindowNavigationItem> |
43 | 59 | </ItemContainerTemplate> |
44 | 60 | </ItemsControl.ItemTemplate> |
45 | 61 | </ItemsControl> |
46 | | - <local:MainWindowNavigationItem Content="Login" ExtraNavigationInformation="" Click="Login_Click"/> |
47 | | - </StackPanel> |
48 | | - <TextBlock x:Name="tbContentTitle" Grid.Column="1" FontSize="22" FontWeight="Bold" Text="{Binding Title}"/> |
| 62 | + <TextBlock x:Name="tbContentTitle" Grid.Column="1" FontSize="22" FontWeight="Bold" Text="{Binding Content.Title, ElementName=frContent}"/> |
49 | 63 | <ScrollViewer Grid.Column="1" Grid.Row="1" VerticalScrollBarVisibility="Auto" > |
50 | | - <Frame x:Name="frContent" Grid.Column="1" Grid.Row="1" NavigationUIVisibility="Hidden" Navigated="frContent_Navigated" Source="{Binding CurrentVisiblePage}"/> |
| 64 | + <Frame x:Name="frContent" Grid.Column="1" Grid.Row="1" NavigationUIVisibility="Hidden" Source="{Binding CurrentVisiblePage, Mode=TwoWay}"/> |
51 | 65 | </ScrollViewer> |
52 | 66 | </Grid> |
53 | 67 | </Window> |
0 commit comments