|
|
@@ -0,0 +1,54 @@
|
|
|
+<Window x:Class="Awesomeness.GUI.Views.DataBoxView"
|
|
|
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
+ xmlns:local="clr-namespace:Awesomeness.GUI"
|
|
|
+ xmlns:viewmodels="clr-namespace:Awesomeness.GUI.ViewModels"
|
|
|
+ d:DataContext="{d:DesignInstance Type=viewmodels:DataBoxViewModel}"
|
|
|
+ mc:Ignorable="d"
|
|
|
+ Title="DataBoxView" Height="450" Width="800">
|
|
|
+ <Grid>
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="20" />
|
|
|
+ <RowDefinition Height="*" />
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+
|
|
|
+ <Menu Grid.Row="0">
|
|
|
+ <MenuItem Header="_File">
|
|
|
+ <MenuItem Header="E_xit" Command="{x:Static ApplicationCommands.Close}" />
|
|
|
+ <MenuItem Header="New User" Command="{Binding AddUserCommand}" />
|
|
|
+ </MenuItem>
|
|
|
+ </Menu>
|
|
|
+ <TextBlock Grid.Row="1" Text="{Binding AFantasticString}" />
|
|
|
+
|
|
|
+ <DataGrid Grid.Row="2" ItemsSource="{Binding Users}"
|
|
|
+ AutoGenerateColumns="False"
|
|
|
+ SelectionMode="Extended"
|
|
|
+ SelectionUnit="CellOrRowHeader"
|
|
|
+ AlternationCount="2"
|
|
|
+ AlternatingRowBackground="Beige"
|
|
|
+ RowBackground="Aquamarine"
|
|
|
+ CanUserAddRows="False"
|
|
|
+ CanUserReorderColumns="False">
|
|
|
+ <DataGrid.Columns>
|
|
|
+ <DataGridTextColumn Binding="{Binding Id, Mode=OneWay}" Header="Id" Width="auto" IsReadOnly="True" />
|
|
|
+ <DataGridTextColumn Binding="{Binding Name}" Header="Min första kolumn" Width="auto" />
|
|
|
+ <DataGridTextColumn Binding="{Binding Age}" Header="Min andra kolumn" Width="auto" />
|
|
|
+ <DataGridCheckBoxColumn Binding="{Binding IsAdmin}" Header="Admin" Width="auto" />
|
|
|
+ <DataGridTemplateColumn Header="Actions" Width="*">
|
|
|
+ <DataGridTemplateColumn.CellTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <StackPanel Orientation="Horizontal" Background="Red">
|
|
|
+ <Button Content="Delete" Command="{Binding DataContext.RemoveUserCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
|
|
+ CommandParameter="{Binding}"
|
|
|
+ Margin="10,0" />
|
|
|
+ </StackPanel>
|
|
|
+ </DataTemplate>
|
|
|
+ </DataGridTemplateColumn.CellTemplate>
|
|
|
+ </DataGridTemplateColumn>
|
|
|
+ </DataGrid.Columns>
|
|
|
+ </DataGrid>
|
|
|
+ </Grid>
|
|
|
+</Window>
|