161 lines
6.6 KiB
XML
161 lines
6.6 KiB
XML
<Window
|
|
x:Class="DrillTools.MainWindow"
|
|
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:DrillTools"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
Title="钻带处理工具(支持拖入钻带文件)"
|
|
Width="1000"
|
|
Height="550"
|
|
AllowDrop="True"
|
|
mc:Ignorable="d">
|
|
|
|
<Window.DataContext>
|
|
<local:MainWindowViewModel />
|
|
</Window.DataContext>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- 工具栏 -->
|
|
<ToolBar Grid.Row="0">
|
|
<Button
|
|
Name="LoadSampleDataButton"
|
|
Click="LoadSampleDataButton_Click"
|
|
Content="加载示例数据" />
|
|
<Separator />
|
|
<Button
|
|
Name="LoadDrillTapeButton"
|
|
Click="LoadDrillTapeButton_Click"
|
|
Content="加载钻带文件" />
|
|
<Button
|
|
Name="ReorderToolsButton"
|
|
Click="ReorderToolsButton_Click"
|
|
Content="重排刀序" />
|
|
<Button
|
|
Name="ApplyOrderButton"
|
|
Click="ApplyOrderButton_Click"
|
|
Content="应用并保存"
|
|
IsEnabled="{Binding HasOriginalFile}" />
|
|
</ToolBar>
|
|
|
|
<!-- 主内容区域 -->
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- 刀具列表 -->
|
|
<GroupBox Grid.Column="0" Header="刀具列表(可拖动排序)">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<ListView
|
|
Name="ToolsListView"
|
|
Grid.Row="0"
|
|
AllowDrop="True"
|
|
ItemsSource="{Binding Tools}"
|
|
MouseDoubleClick="ToolsListView_MouseDoubleClick"
|
|
SelectedItem="{Binding SelectedTool}">
|
|
<ListView.View>
|
|
<GridView>
|
|
<GridViewColumn
|
|
Width="80"
|
|
DisplayMemberBinding="{Binding ToolNumber, StringFormat=T{0:D2}}"
|
|
Header="刀具编号" />
|
|
<GridViewColumn
|
|
Width="80"
|
|
DisplayMemberBinding="{Binding Diameter, StringFormat=F3}"
|
|
Header="孔径(mm)" />
|
|
<GridViewColumn
|
|
Width="70"
|
|
DisplayMemberBinding="{Binding ToolTypeDisplay}"
|
|
Header="类型" />
|
|
<GridViewColumn
|
|
Width="90"
|
|
DisplayMemberBinding="{Binding ToolSuffixTypeDisplay}"
|
|
Header="尾号类型" />
|
|
</GridView>
|
|
</ListView.View>
|
|
<ListView.ItemContainerStyle>
|
|
<Style BasedOn="{StaticResource {x:Type ListViewItem}}" TargetType="ListViewItem">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="#E0E0E0" />
|
|
</Trigger>
|
|
<Trigger Property="IsSelected" Value="True">
|
|
<Setter Property="Background" Value="#0078D4" />
|
|
<Setter Property="Foreground" Value="White" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</ListView.ItemContainerStyle>
|
|
</ListView>
|
|
|
|
<!-- 插入位置指示器 -->
|
|
<Rectangle
|
|
x:Name="InsertionIndicator"
|
|
Grid.Row="0"
|
|
Height="2"
|
|
Margin="0,0,0,0"
|
|
HorizontalAlignment="Stretch"
|
|
Fill="#FF0078D4"
|
|
IsHitTestVisible="False"
|
|
Visibility="Collapsed" />
|
|
|
|
<!-- 上移/下移按钮 -->
|
|
<StackPanel
|
|
Grid.Row="1"
|
|
Margin="0,5,0,5"
|
|
HorizontalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<Button
|
|
Name="MoveUpButton"
|
|
Width="80"
|
|
Height="35"
|
|
Margin="5,0"
|
|
Click="MoveUpButton_Click"
|
|
Content="↑ 上移"
|
|
IsEnabled="{Binding CanMoveUp}" />
|
|
<Button
|
|
Name="MoveDownButton"
|
|
Width="80"
|
|
Height="35"
|
|
Margin="5,0"
|
|
Click="MoveDownButton_Click"
|
|
Content="↓ 下移"
|
|
IsEnabled="{Binding CanMoveDown}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<!-- 钻带内容显示 -->
|
|
<GroupBox Grid.Column="1" Header="钻带内容">
|
|
<TextBox
|
|
Name="DrillTapeTextBox"
|
|
HorizontalScrollBarVisibility="Auto"
|
|
IsReadOnly="True"
|
|
Style="{StaticResource CodeTextBoxStyle}"
|
|
Text="{Binding DrillTapeContent}"
|
|
TextWrapping="Wrap"
|
|
VerticalScrollBarVisibility="Auto" />
|
|
</GroupBox>
|
|
</Grid>
|
|
|
|
<!-- 状态栏 -->
|
|
<StatusBar Grid.Row="2">
|
|
<StatusBarItem>
|
|
<TextBlock Text="就绪" />
|
|
</StatusBarItem>
|
|
</StatusBar>
|
|
</Grid>
|
|
</Window> |