Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <UserControl x:Class="MVVM_Test.UserControl1"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
- xmlns:y="clr-namespace:MVVM_Test.Util"
- xmlns:vm="clr-namespace:MVVM_Test.ViewModel"
- mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="400" >
- <UserControl.Resources>
- <y:DateTimeConverter x:Key="dateTimeConverter" />
- <y:ColorConverter x:Key="colorConverter" />
- </UserControl.Resources>
- <UserControl.DataContext>
- <vm:ViewModel/>
- </UserControl.DataContext>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="115"/>
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <DatePicker Name="HistoryDateTime" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Center" DisplayDateStart="{Binding Path=StartDate}" DisplayDateEnd="{Binding Path=EndDate}" SelectedDate="{Binding Path=SelectedDate}" >
- <interactivity:Interaction.Triggers>
- </interactivity:Interaction.Triggers>
- </DatePicker>
- <Button Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Name="PrevHistoryDateButton" Command="{Binding Mode=OneTime, Path=PrevHistory_cmd}" >Prev</Button>
- <Button Grid.Column="2" Grid.Row="1" HorizontalAlignment="Right" Name="NextHistoryDateButton" Command="{Binding Mode=OneTime, Path=NextHistory_cmd}">Next</Button>
- <Grid Grid.Row="2">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="1.9*"/>
- <ColumnDefinition Width="1.33*"/>
- <ColumnDefinition Width="1.15*"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition />
- </Grid.RowDefinitions>
- <Label>Width:</Label>
- <Label Grid.Row="1">Height:</Label>
- <Label Grid.Row="2">Length:</Label>
- <Label Grid.Row="3">Weight:</Label>
- <Label Name="WidthCurrentBrickLabel" Grid.Column="1" >000</Label>
- <Label Name="HeightCurrentBrickLabel" Grid.Column="1" Grid.Row="1">000</Label>
- <Label Name="LengthCurrentBrickLabel" Grid.Column="1" Grid.Row="2">000</Label>
- <Label Name="WeightCurrentBrickLabel" Grid.Column="1" Grid.Row="3">000</Label>
- <Label Grid.Column="2">mm</Label>
- <Label Grid.Row="1" Grid.Column="2">mm</Label>
- <Label Grid.Row="2" Grid.Column="2">mm</Label>
- <Label Grid.Row="3" Grid.Column="2">g</Label>
- </Grid>
- <Button Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2">Start</Button>
- </Grid>
- <Grid Grid.Column="0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <DataGrid Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="1" ItemsSource="{Binding Path=SavedBricks}" CanUserReorderColumns="False" CanUserResizeColumns="False" AutoGenerateColumns="False">
- <DataGrid.Columns>
- <DataGridTextColumn Header="Time" Binding="{Binding Time, Converter={StaticResource dateTimeConverter}}" IsReadOnly="True" />
- <DataGridTemplateColumn Header="Type">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <Rectangle Fill="{Binding Path=BrickType, Converter={StaticResource colorConverter}}" Stroke="Black" Width="10" Height="10" DataContext="{Binding}" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTextColumn Header="Height" Binding="{Binding Height}" IsReadOnly="False"/>
- <DataGridTextColumn Header="Width" Binding="{Binding Width}" IsReadOnly="False"/>
- <DataGridTextColumn Header="Length" Binding="{Binding Length}" IsReadOnly="False"/>
- <DataGridTextColumn Header="Weight" Binding="{Binding Weight}" IsReadOnly="False"/>
- <DataGridTextColumn Header="Density" Binding="{Binding Density}" IsReadOnly="False" Width="SizeToHeader"/>
- </DataGrid.Columns>
- </DataGrid>
- </Grid>
- </Grid>
- </UserControl>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement