|
4 | 4 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
5 | 5 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
6 | 6 | xmlns:local="clr-namespace:View" |
| 7 | + xmlns:vm="clr-namespace:ViewModel;assembly=ViewModel" |
| 8 | + xmlns:vmc="clr-namespace:ViewModel.Commands;assembly=ViewModel" |
7 | 9 | mc:Ignorable="d" |
8 | | - Title="MainWindow" Height="450" Width="800"> |
9 | | - <DockPanel LastChildFill="True"> |
10 | | - <DockPanel.DataContext> |
11 | | - <local:MainMenuData/> |
12 | | - </DockPanel.DataContext> |
13 | | - <StackPanel DockPanel.Dock="Left" Width="100"> |
14 | | - <Grid Height="{Binding ActualHeight, ElementName=tbContentTitle, Mode=OneWay}"> |
15 | | - <Grid.ColumnDefinitions> |
16 | | - <ColumnDefinition Width="1*" /> |
17 | | - <ColumnDefinition Width="1*" /> |
18 | | - </Grid.ColumnDefinitions> |
19 | | - <Button x:Name="btPreviousButton" Content="<" Margin="5,5,5,5" Click="NavigationNextPreviousButton_Click"/> |
20 | | - <Button x:Name="btNextButton" Content=">" Grid.Column="1" Margin="5" Click="NavigationNextPreviousButton_Click"/> |
21 | | - </Grid> |
22 | | - <!-- The Stackpanel doesn't allow a binding for its children, so we use a ItemsControl instead --> |
23 | | - <ItemsControl x:Name="icMenuItems" ItemsSource="{Binding MainNavigationItems}"> |
| 10 | + Style="{StaticResource {x:Type Window}}" |
| 11 | + Title="Stugether" Height="450" Width="800"> |
| 12 | + <Window.DataContext> |
| 13 | + <vm:MainPageViewModel/> |
| 14 | + </Window.DataContext> |
| 15 | + <Grid> |
| 16 | + <Grid.ColumnDefinitions> |
| 17 | + <ColumnDefinition MaxWidth="150"/> |
| 18 | + <ColumnDefinition Width="6*"/> |
| 19 | + </Grid.ColumnDefinitions> |
| 20 | + <Grid.RowDefinitions> |
| 21 | + <RowDefinition Height="35"/> |
| 22 | + <RowDefinition Height="1*"/> |
| 23 | + </Grid.RowDefinitions> |
| 24 | + <Grid Height="{Binding ActualHeight, ElementName=tbContentTitle, Mode=OneWay}"> |
| 25 | + <Grid.ColumnDefinitions> |
| 26 | + <ColumnDefinition Width="1*" /> |
| 27 | + <ColumnDefinition Width="1*" /> |
| 28 | + </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"/> |
| 31 | + </Grid> |
| 32 | + <!-- 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 | + <ItemsControl x:Name="icMenuItems" Grid.Row="1" ItemsSource="{Binding MainNavigationItems}"> |
24 | 35 | <ItemsControl.ItemsPanel> |
25 | 36 | <ItemsPanelTemplate> |
26 | 37 | <StackPanel IsItemsHost="True"/> |
27 | 38 | </ItemsPanelTemplate> |
28 | 39 | </ItemsControl.ItemsPanel> |
29 | 40 | <ItemsControl.ItemTemplate> |
30 | 41 | <ItemContainerTemplate> |
31 | | - <local:MainWindowNavigationItem Content="{Binding Title}" Page="{Binding Page}" ExtraNavigationInformation="{Binding ExtraInformation}" Click="MainWindowNavigationItem_Click"/> |
| 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}"/> |
32 | 43 | </ItemContainerTemplate> |
33 | 44 | </ItemsControl.ItemTemplate> |
34 | 45 | </ItemsControl> |
| 46 | + <local:MainWindowNavigationItem Content="Login" ExtraNavigationInformation="" Click="Login_Click"/> |
35 | 47 | </StackPanel> |
36 | | - <TextBlock x:Name="tbContentTitle" DockPanel.Dock="Top" Text="Title" FontSize="22" FontWeight="Bold"/> |
37 | | - <Frame x:Name="frContent" NavigationUIVisibility="Hidden" Navigated="frContent_Navigated"/> |
38 | | - </DockPanel> |
| 48 | + <TextBlock x:Name="tbContentTitle" Grid.Column="1" FontSize="22" FontWeight="Bold" Text="{Binding Title}"/> |
| 49 | + <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}"/> |
| 51 | + </ScrollViewer> |
| 52 | + </Grid> |
39 | 53 | </Window> |
0 commit comments