Files
DP44/Common/DTS.CommonCore/Controls/ISOPopup.xaml
2026-04-17 14:55:32 -04:00

150 lines
12 KiB
XML

<Popup x:Class="DTS.Common.Controls.ISOPopup"
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:DTS.Common.Controls"
xmlns:converters="clr-namespace:DTS.Common.Converters"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Popup.Resources>
<converters:BooleanOrMultiConverter x:Key="BooleanOrMultiConverter" />
</Popup.Resources>
<Popup.Style>
<Style TargetType="Popup">
<Setter Property="IsOpen" Value="False"/>
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding CodeType}" Value="ISO" />
<Condition Binding="{Binding ShowISOStringBuilder}" Value="True" />
<Condition Value="True">
<Condition.Binding>
<MultiBinding Converter="{StaticResource BooleanOrMultiConverter}">
<Binding ElementName="MainEditBox" Path="IsKeyboardFocused" />
<Binding ElementName="ISOPopup" Path="IsMouseOver" />
<Binding ElementName="ISOPopup" Path="IsKeyboardFocusWithin" />
<Binding ElementName="possibleChannels" Path="IsKeyboardFocusWithin"/>
</MultiBinding>
</Condition.Binding>
</Condition>
</MultiDataTrigger.Conditions>
<Setter Property="IsOpen" Value="True" />
</MultiDataTrigger>
</Style.Triggers>
</Style>
</Popup.Style>
<Border Background="#FFEEEEEE" BorderBrush="#FF888888" BorderThickness="1" >
<StackPanel Orientation="Horizontal">
<StackPanel>
<TextBlock Text="Test Object" Margin="5"/>
<TextBox HorizontalAlignment="Center" Height="23" TextWrapping="Wrap" VerticalContentAlignment="Center" Width="20" Text="{Binding TestObject, Mode=TwoWay}" Name="txtTO" MaxLength="1" GotKeyboardFocus="ISOPart_OnGotKeyboardFocus" GotMouseCapture="ISOPart_OnGotMouseCapture" PreviewKeyUp="ISOPart_OnPreviewKeyUp"
IsReadOnly="True" Background="Transparent" BorderBrush="Transparent"
AutomationProperties.AutomationId="CCB_ISOPopupTestObjectTextBox">
<TextBox.InputBindings>
<KeyBinding Key="Enter"
Command="{local:UpdatePropertySourceWhenEnterPressed}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type TextBox}}}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<StackPanel>
<TextBlock Text="Position" Margin="5"/>
<TextBox HorizontalAlignment="Center" Height="23" TextWrapping="Wrap" VerticalContentAlignment="Center" Width="20" Text="{Binding Position}" Name="txtPosition" MaxLength="1" GotKeyboardFocus="ISOPart_OnGotKeyboardFocus" GotMouseCapture="ISOPart_OnGotMouseCapture" PreviewKeyUp="ISOPart_OnPreviewKeyUp"
IsReadOnly="True" Background="Transparent" BorderBrush="Transparent"
AutomationProperties.AutomationId="CCB_ISOPopupPositionTextBox">
<TextBox.InputBindings>
<KeyBinding Key="Enter"
Command="{local:UpdatePropertySourceWhenEnterPressed}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type TextBox}}}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<StackPanel>
<TextBlock Text="Main Location" Margin="5"/>
<TextBox HorizontalAlignment="Center" Height="23" TextWrapping="Wrap" VerticalContentAlignment="Center" Width="40" Text="{Binding MainLocation}" Name="txtMainLoc" MaxLength="4" GotKeyboardFocus="ISOPart_OnGotKeyboardFocus" GotMouseCapture="ISOPart_OnGotMouseCapture" PreviewKeyUp="ISOPart_OnPreviewKeyUp"
IsReadOnly="True" Background="Transparent" BorderBrush="Transparent"
AutomationProperties.AutomationId="CCB_ISOPopupMainLocationTextBox">
<TextBox.InputBindings>
<KeyBinding Key="Enter"
Command="{local:UpdatePropertySourceWhenEnterPressed}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type TextBox}}}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<StackPanel>
<TextBlock Text="Fine Loc1" Margin="5"/>
<TextBox HorizontalAlignment="Center" Height="23" TextWrapping="Wrap" VerticalContentAlignment="Center" Width="30" Text="{Binding FineLocation1}" Name="txtFL1" MaxLength="2" GotKeyboardFocus="ISOPart_OnGotKeyboardFocus" GotMouseCapture="ISOPart_OnGotMouseCapture" PreviewKeyUp="ISOPart_OnPreviewKeyUp"
IsReadOnly="True" Background="Transparent" BorderBrush="Transparent"
AutomationProperties.AutomationId="CCB_ISOPopupFineLocation1TextBox">
<TextBox.InputBindings>
<KeyBinding Key="Enter"
Command="{local:UpdatePropertySourceWhenEnterPressed}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type TextBox}}}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<StackPanel>
<TextBlock Text="Fine Loc2" Margin="5"/>
<TextBox HorizontalAlignment="Center" Height="23" TextWrapping="Wrap" VerticalContentAlignment="Center" Width="30" Text="{Binding FineLocation2}" Name="txtFL2" MaxLength="2" GotKeyboardFocus="ISOPart_OnGotKeyboardFocus" GotMouseCapture="ISOPart_OnGotMouseCapture" PreviewKeyUp="ISOPart_OnPreviewKeyUp"
IsReadOnly="True" Background="Transparent" BorderBrush="Transparent"
AutomationProperties.AutomationId="CCB_ISOPopupFineLocation2TextBox">
<TextBox.InputBindings>
<KeyBinding Key="Enter"
Command="{local:UpdatePropertySourceWhenEnterPressed}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type TextBox}}}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<StackPanel>
<TextBlock Text="Fine Loc3" Margin="5"/>
<TextBox HorizontalAlignment="Center" Height="23" TextWrapping="Wrap" VerticalContentAlignment="Center" Width="30" Text="{Binding FineLocation3}" Name="txtFL3" MaxLength="2" GotKeyboardFocus="ISOPart_OnGotKeyboardFocus" GotMouseCapture="ISOPart_OnGotMouseCapture" PreviewKeyUp="ISOPart_OnPreviewKeyUp"
IsReadOnly="True" Background="Transparent" BorderBrush="Transparent"
AutomationProperties.AutomationId="CCB_ISOPopupFineLocation3TextBox">
<TextBox.InputBindings>
<KeyBinding Key="Enter"
Command="{local:UpdatePropertySourceWhenEnterPressed}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type TextBox}}}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<StackPanel>
<TextBlock Text="Dimension" Margin="5"/>
<TextBox HorizontalAlignment="Center" Height="23" TextWrapping="Wrap" VerticalContentAlignment="Center" Width="30" Text="{Binding Dimension}" Name="txtDim" MaxLength="2" GotKeyboardFocus="ISOPart_OnGotKeyboardFocus" GotMouseCapture="ISOPart_OnGotMouseCapture" PreviewKeyUp="ISOPart_OnPreviewKeyUp"
IsReadOnly="True" Background="Transparent" BorderBrush="Transparent"
AutomationProperties.AutomationId="CCB_ISOPopupDimensionTextBox">
<TextBox.InputBindings>
<KeyBinding Key="Enter"
Command="{local:UpdatePropertySourceWhenEnterPressed}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type TextBox}}}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<StackPanel>
<TextBlock Text="Direction" Margin="5"/>
<TextBox HorizontalAlignment="Center" Height="23" TextWrapping="Wrap" VerticalContentAlignment="Center" Width="20" Text="{Binding Direction}" Name="txtDir" MaxLength="1" GotKeyboardFocus="ISOPart_OnGotKeyboardFocus" GotMouseCapture="ISOPart_OnGotMouseCapture" PreviewKeyUp="ISOPart_OnPreviewKeyUp"
IsReadOnly="True" Background="Transparent" BorderBrush="Transparent"
AutomationProperties.AutomationId="CCB_ISOPopupDirectionTextBox">
<TextBox.InputBindings>
<KeyBinding Key="Enter"
Command="{local:UpdatePropertySourceWhenEnterPressed}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type TextBox}}}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<StackPanel>
<TextBlock Text="Filter Class" Margin="5"/>
<TextBox HorizontalAlignment="Center" Height="23" TextWrapping="Wrap" VerticalContentAlignment="Center" Width="20" Text="{Binding FilterClass}" Name="txtFilterClass" MaxLength="1" GotKeyboardFocus="ISOPart_OnGotKeyboardFocus" GotMouseCapture="ISOPart_OnGotMouseCapture" PreviewKeyUp="ISOPart_OnPreviewKeyUp"
IsReadOnly="True" Background="Transparent" BorderBrush="Transparent"
AutomationProperties.AutomationId="CCB_ISOPopupFilterClassTextBox">
<TextBox.InputBindings>
<KeyBinding Key="Enter"
Command="{local:UpdatePropertySourceWhenEnterPressed}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type TextBox}}}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
</StackPanel>
</Border>
</Popup>