Files
ShrlAlgoToolkit/ShrlAlgo.RvKits/RvMEP/AutoConnectOptionsView.xaml

112 lines
4.9 KiB
XML

<StackPanel
x:Class="ShrlAlgo.RvKits.RvMEP.AutoConnectOptionsView"
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:local="clr-namespace:ShrlAlgo.RvKits.RvMEP"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:converters="clr-namespace:ShrlAlgo.Toolkit.Mvvm.Converters"
Height="26"
d:DataContext="{d:DesignInstance Type=local:AnyConnectViewModel}"
Background="#FFE5F0D7"
Orientation="Horizontal"
mc:Ignorable="d">
<StackPanel.Resources>
<converters:ComparisonConverter x:Key="ComparisonConverter" />
<converters:InvertBooleanConverter x:Key="InvertBooleanConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</StackPanel.Resources>
<TextBlock
Padding="10,0,10,0"
VerticalAlignment="Center"
Text="任意管线 | 选项" />
<Border
Width="3"
Background="Gray"
BorderBrush="Azure"
BorderThickness="1,0" />
<TextBlock
Margin="10,0,10,0"
VerticalAlignment="Center"
Text="连接角度:"
ToolTip="平行或垂直连接时生效" />
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
<RadioButton
VerticalAlignment="Center"
Content="默认"
ToolTip="根据当前位置自动连接">
<RadioButton.IsChecked>
<Binding Converter="{StaticResource ComparisonConverter}" Path="Angle">
<Binding.ConverterParameter>
<system:Double>0</system:Double>
</Binding.ConverterParameter>
</Binding>
</RadioButton.IsChecked>
</RadioButton>
<RadioButton VerticalAlignment="Center" Content="15°">
<RadioButton.IsChecked>
<Binding Converter="{StaticResource ComparisonConverter}" Path="Angle">
<Binding.ConverterParameter>
<system:Double>15</system:Double>
</Binding.ConverterParameter>
</Binding>
</RadioButton.IsChecked>
</RadioButton>
<RadioButton VerticalAlignment="Center" Content="22.5°">
<RadioButton.IsChecked>
<Binding Converter="{StaticResource ComparisonConverter}" Path="Angle">
<Binding.ConverterParameter>
<system:Double>22.5</system:Double>
</Binding.ConverterParameter>
</Binding>
</RadioButton.IsChecked>
</RadioButton>
<RadioButton VerticalAlignment="Center" Content="30°">
<RadioButton.IsChecked>
<Binding Converter="{StaticResource ComparisonConverter}" Path="Angle">
<Binding.ConverterParameter>
<system:Double>30</system:Double>
</Binding.ConverterParameter>
</Binding>
</RadioButton.IsChecked>
</RadioButton>
<RadioButton VerticalAlignment="Center" Content="45°">
<RadioButton.IsChecked>
<Binding Converter="{StaticResource ComparisonConverter}" Path="Angle">
<Binding.ConverterParameter>
<system:Double>45</system:Double>
</Binding.ConverterParameter>
</Binding>
</RadioButton.IsChecked>
</RadioButton>
<RadioButton VerticalAlignment="Center" Content="60°">
<RadioButton.IsChecked>
<Binding Converter="{StaticResource ComparisonConverter}" Path="Angle">
<Binding.ConverterParameter>
<system:Double>60</system:Double>
</Binding.ConverterParameter>
</Binding>
</RadioButton.IsChecked>
</RadioButton>
<RadioButton VerticalAlignment="Center" Content="90°">
<RadioButton.IsChecked>
<Binding Converter="{StaticResource ComparisonConverter}" Path="Angle">
<Binding.ConverterParameter>
<system:Double>90</system:Double>
</Binding.ConverterParameter>
</Binding>
</RadioButton.IsChecked>
</RadioButton>
<RadioButton
x:Name="LbCustom"
VerticalAlignment="Center"
Content="自定义:" />
<TextBox
Width="80"
VerticalAlignment="Center"
Text="{Binding Angle, UpdateSourceTrigger=PropertyChanged, StringFormat={}{0}°}"
Visibility="{Binding IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=LbCustom}" />
</StackPanel>
</StackPanel>