70 lines
3.0 KiB
XML
70 lines
3.0 KiB
XML
<UserControl x:Class="PLCSharp.Core.UserControls.SimpleCell"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:comm="clr-namespace:PLCSharp.Core.Common"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:PLCSharp.Core.UserControls"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
mc:Ignorable="d"
|
|
d:DataContext="{d:DesignInstance Type=local:SimpleCellViewModel}"
|
|
d:DesignHeight="450" d:DesignWidth="800"
|
|
Background="{Binding Background}">
|
|
|
|
<UserControl.Resources>
|
|
<ObjectDataProvider x:Key="CellState" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
|
|
<ObjectDataProvider.MethodParameters>
|
|
<x:Type TypeName="comm:CellState" />
|
|
</ObjectDataProvider.MethodParameters>
|
|
</ObjectDataProvider>
|
|
</UserControl.Resources>
|
|
<UserControl.ContextMenu>
|
|
|
|
<ContextMenu ItemsSource="{Binding Source={StaticResource CellState}}">
|
|
<ContextMenu.ItemContainerStyle>
|
|
<Style TargetType="MenuItem">
|
|
<Setter Property="Command" Value="{Binding Path=DataContext.MenuItemCommand, RelativeSource={RelativeSource AncestorType=ContextMenu}}" />
|
|
<Setter Property="CommandParameter" Value="{Binding}" />
|
|
<Setter Property="Header" Value="{Binding}" />
|
|
</Style>
|
|
</ContextMenu.ItemContainerStyle>
|
|
</ContextMenu>
|
|
|
|
</UserControl.ContextMenu>
|
|
<Border BorderBrush="Black" BorderThickness="1">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="2*" />
|
|
<RowDefinition Height="2*" />
|
|
<RowDefinition Height="2*" />
|
|
|
|
</Grid.RowDefinitions>
|
|
<Viewbox HorizontalAlignment="Left" VerticalAlignment="Bottom">
|
|
<TextBlock>
|
|
<TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0} ({1}- {2})">
|
|
<Binding Path="CellInfo.Index" />
|
|
<Binding Path="CellInfo.Row" />
|
|
<Binding Path="CellInfo.Column" />
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
</Viewbox>
|
|
|
|
<Viewbox HorizontalAlignment="Right" VerticalAlignment="Top">
|
|
<TextBlock Text="{Binding CellInfo.State}" />
|
|
</Viewbox>
|
|
|
|
<Grid Grid.RowSpan="3" Margin="0,5">
|
|
<Viewbox>
|
|
<TextBlock Text="{Binding CellInfo.Info}" />
|
|
</Viewbox>
|
|
</Grid>
|
|
|
|
<Viewbox Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom">
|
|
<TextBlock Text="{Binding CellInfo.Tag}" />
|
|
</Viewbox>
|
|
</Grid>
|
|
</Border>
|
|
</UserControl>
|