Advertisement
Guest User

MainWindowView

a guest
Sep 12th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.42 KB | None | 0 0
  1. <controls:MetroWindow x:Class="Margo.UI.View.MainWindowView"
  2.                       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.                       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4.                       xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5.                       xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6.                       xmlns:views="clr-namespace:Margo.UI.View"
  7.                       xmlns:vm="clr-namespace:Margo.UI.ViewModel"
  8.                       xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
  9.                       mc:Ignorable="d"
  10.                       Title="MainWindowView" Height="300" Width="500"
  11.                       GlowBrush="{DynamicResource AccentColorBrush}">
  12.     <Window.DataContext>
  13.         <vm:MainWindowViewModel />
  14.     </Window.DataContext>
  15.     <Window.Resources>
  16.         <DataTemplate DataType="{x:Type vm:ShoppingListViewModel}">
  17.             <views:ShoppingListView />
  18.         </DataTemplate>
  19.         <DataTemplate DataType="{x:Type vm:ProductsViewModel}">
  20.             <views:ProductsView />
  21.         </DataTemplate>
  22.         <DataTemplate DataType="{x:Type vm:AddProductViewModel}">
  23.             <views:AddProductView/>
  24.         </DataTemplate>
  25.     </Window.Resources>
  26.     <Grid Background="White">
  27.         <Grid.ColumnDefinitions>
  28.             <ColumnDefinition Width="150" />
  29.             <ColumnDefinition />
  30.             <ColumnDefinition />
  31.         </Grid.ColumnDefinitions>
  32.         <Grid.RowDefinitions>
  33.             <RowDefinition />
  34.             <RowDefinition />
  35.             <RowDefinition />
  36.         </Grid.RowDefinitions>
  37.         <StackPanel x:Name="NavPanel"
  38.                     Grid.Row="0"
  39.                     Grid.Column="0"
  40.                     Margin="10,10"
  41.                     Background="DarkGray">
  42.             <Button Content="Shopping List"
  43.                     Command="{Binding NavCommand}"
  44.                     CommandParameter="shoppingList" />
  45.             <Button Content="Products"
  46.                     Command="{Binding NavCommand}"
  47.                     CommandParameter="products" />
  48.         </StackPanel>
  49.  
  50.         <ContentControl Grid.Column="1"
  51.                         Grid.Row="0"
  52.                         Grid.ColumnSpan="2"
  53.                         Grid.RowSpan="3"
  54.                         Content="{Binding CurrentViewModel}" />
  55.     </Grid>
  56. </controls:MetroWindow>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement