2026-01-26 18:56:53 +09:00

104 lines
5.8 KiB
XML

<UserControl x:Class="WeldingCommon.Views.UCWorkPos"
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:local="clr-namespace:WeldingCommon.Views"
xmlns:behavior="http://schemas.microsoft.com/xaml/behaviors"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
d:DataContext="{d:DesignInstance Type=local:WorkPosViewModel}"
mc:Ignorable="d"
x:Name="ucWorkPos"
d:DesignHeight="80" d:DesignWidth="500">
<UserControl.Resources>
<ResourceDictionary>
<Style x:Key="StBorderGroup1" TargetType="Border">
<Setter Property="Background" Value="{StaticResource BNavy}"/>
<Setter Property="Margin" Value="2 0 2 2"/>
<Setter Property="Padding" Value="3"/>
</Style>
<Style x:Key="StBorderGroup2" TargetType="Border">
<Setter Property="Background" Value="{StaticResource BMSDarkGray}"/>
<Setter Property="Margin" Value="2 0 2 2"/>
<Setter Property="Padding" Value="0"/>
</Style>
<Style x:Key="StButtonAccent4" TargetType="{x:Type Button}" BasedOn="{StaticResource StButtonAccent}">
<Setter Property="Background" Value="#FF760025" />
<!-- BLGRedCustomDark -->
<Setter Property="Foreground" Value="White" />
<Setter Property="BorderBrush" Value="#FF760025" />
<!-- BLGRedCustomDark -->
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="Bold"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#A50034" />
<!-- BLGRed -->
<Setter Property="Foreground" Value="#cfd4e6" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#A50034" />
<!-- BLGRed -->
<Setter Property="Foreground" Value="White" />
</Trigger>
</Style.Triggers>
</Style>
<local:LastPositionConverter x:Key="convLastPosition"/>
</ResourceDictionary>
</UserControl.Resources>
<behavior:Interaction.Triggers>
<behavior:PropertyChangedTrigger Binding="{Binding IsVisible, ElementName=ucWorkPos}">
<behavior:InvokeCommandAction Command="{Binding CMD_VisibleChanged}" CommandParameter="{Binding IsVisible, ElementName=ucWorkPos}"/>
</behavior:PropertyChangedTrigger>
</behavior:Interaction.Triggers>
<Grid Margin="0 1" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<!-- Main sequence 에 맞게 길이 조절 필요함. Loading, Working, Unloading -->
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1*"/>
<!-- <ColumnDefinition Width="1*"/> -->
</Grid.ColumnDefinitions>
<Border Grid.Column="1" Grid.Row="0" Style="{StaticResource StBorderGroup2}">
<TextBlock Text="Start" Padding="2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="11" FontWeight="Bold"></TextBlock>
</Border>
<Border Grid.Column="2" Grid.Row="0" Style="{StaticResource StBorderGroup2}">
<TextBlock Text="Working" Padding="2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="11" FontWeight="Bold"></TextBlock>
</Border>
<Border Grid.Column="3" Grid.Row="0" Style="{StaticResource StBorderGroup2}">
<TextBlock Text="Done" Padding="2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="11" FontWeight="Bold"></TextBlock>
</Border>
<Border Grid.Column="0" Grid.Row="1" Style="{StaticResource StBorderGroup1}">
<TextBlock Text="State" Padding="2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12" FontWeight="Bold"></TextBlock>
</Border>
<ItemsControl Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="8" ItemsSource="{Binding WorkingPositions}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="{Binding DataContext.WorkingPositions.Count, ElementName=ucWorkPos}"></UniformGrid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="2 0 2 2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<local:UCBlinkText DataContext="{Binding Value}"></local:UCBlinkText>
<iconPacks:PackIconUnicons Kind="AngleRightB" Grid.Column="1" Visibility="{Binding Key, Converter={StaticResource convLastPosition}}" VerticalAlignment="Center" Width="5"></iconPacks:PackIconUnicons>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</UserControl>