整理代码
This commit is contained in:
103
ShrlAlgoToolkit.RevitAddins/RvView/SectionBoxControllerView.xaml
Normal file
103
ShrlAlgoToolkit.RevitAddins/RvView/SectionBoxControllerView.xaml
Normal file
@@ -0,0 +1,103 @@
|
||||
<ui:FluentWindowEx
|
||||
x:Class="ShrlAlgo.RvKits.RvView.SectionBoxControllerView"
|
||||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:rvManager="clr-namespace:ShrlAlgo.RvKits.RvView"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
Title="剖面框"
|
||||
Width="340"
|
||||
Height="360"
|
||||
MinWidth="340"
|
||||
MinHeight="360"
|
||||
d:DataContext="{d:DesignInstance Type=rvManager:SectionBoxControllerViewModel}"
|
||||
mc:Ignorable="d">
|
||||
<Window.Resources>
|
||||
<ResourceDictionary Source="pack://application:,,,/ShrlAlgoToolkit.RevitAddins;component/WPFUI.xaml" />
|
||||
</Window.Resources>
|
||||
<ui:AutoGrid
|
||||
ChildMargin="5"
|
||||
Columns="*,*"
|
||||
Rows="*,Auto,Auto,Auto">
|
||||
<GroupBox Grid.ColumnSpan="2">
|
||||
<GroupBox.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ui:SymbolIcon Symbol="History16" />
|
||||
<TextBlock Margin="5,0,0,0" Text="历史记录" />
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
<ListBox
|
||||
x:Name="HistoryListBox"
|
||||
HorizontalContentAlignment="Center"
|
||||
d:ItemsSource="{d:SampleData ItemCount=5}"
|
||||
DisplayMemberPath="Name"
|
||||
ItemsSource="{Binding BoundingBoxes}"
|
||||
SelectedValuePath="Bounding" />
|
||||
</GroupBox>
|
||||
<Grid Grid.Row="1" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<GroupBox Header="设置方式">
|
||||
<UniformGrid Rows="1">
|
||||
<RadioButton
|
||||
Content="元素"
|
||||
IsChecked="{Binding SectionBoxType, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static rvManager:SectionBoxType.Element}}"
|
||||
ToolTip="根据选择元素设置剖面框" />
|
||||
<RadioButton
|
||||
Content="框选"
|
||||
IsChecked="{Binding SectionBoxType, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static rvManager:SectionBoxType.Rectangle}}"
|
||||
ToolTip="根据框选范围设置剖面框" />
|
||||
<RadioButton
|
||||
Content="剖面"
|
||||
IsChecked="{Binding SectionBoxType, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static rvManager:SectionBoxType.ViewSection}}"
|
||||
ToolTip="根据剖面的范围设置剖面框" />
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<CheckBox
|
||||
Grid.Column="1"
|
||||
Margin="5"
|
||||
HorizontalAlignment="Center"
|
||||
Content="是否延展"
|
||||
IsChecked="{Binding NeedExtend}"
|
||||
ToolTip="是否延展剖面框边界" />
|
||||
</Grid>
|
||||
<ui:Button
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
Command="{Binding RecordSectionBoxCommand}"
|
||||
Content="临时记录"
|
||||
Icon="{ui:SymbolIcon Add32}"
|
||||
ToolTip="记录剖面框,以便复用" />
|
||||
<ui:Button
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Command="{Binding RemoveSectionBoxCommand}"
|
||||
CommandParameter="{Binding SelectedItem, ElementName=HistoryListBox}"
|
||||
Content="删除记录"
|
||||
Icon="{ui:SymbolIcon Delete32}"
|
||||
ToolTip="删除已记录的剖面框" />
|
||||
<ui:Button
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
Command="{Binding UpdateSectionBoxCommand}"
|
||||
CommandParameter="{Binding SelectedValue, ElementName=HistoryListBox}"
|
||||
Content="恢复剖面框"
|
||||
Icon="{ui:SymbolIcon Replay20}"
|
||||
ToolTip="返回历史记录的剖面框" />
|
||||
<ui:Button
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Command="{Binding ResetSectionBoxCommand}"
|
||||
Content="设置剖面框"
|
||||
Icon="{ui:SymbolIcon Box20}"
|
||||
ToolTip="重新设置新的剖面框" />
|
||||
</ui:AutoGrid>
|
||||
</ui:FluentWindowEx>
|
||||
Reference in New Issue
Block a user