Files
AohDrllTools/App.xaml
Mr.Xia 6361f17598 支持拖拽钻带文件到exe自动打开并加载
实现了命令行参数解析,支持将钻带文件(.txt, .drl, .dr2, .dpin)拖拽到exe上直接打开。重构了 App 启动流程,MainWindow 构造函数支持初始文件路径,窗口加载后自动异步读取并解析文件内容。增强了异常处理,提升了启动健壮性和用户体验。
2025-12-30 18:42:03 +08:00

89 lines
4.1 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<Application x:Class="DrillTools.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DrillTools"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<Application.Resources>
<!-- 布尔值到可见性转换器 -->
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<!-- 全局字体大小定义 -->
<sys:Double x:Key="DefaultFontSize">14</sys:Double>
<sys:Double x:Key="LargeFontSize">16</sys:Double>
<sys:Double x:Key="SmallFontSize">12</sys:Double>
<sys:Double x:Key="CodeFontSize">12</sys:Double>
<!-- 默认字体族 -->
<FontFamily x:Key="DefaultFontFamily">Microsoft YaHei UI</FontFamily>
<FontFamily x:Key="CodeFontFamily">Consolas</FontFamily>
<!-- 基础文本样式 -->
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="{StaticResource DefaultFontSize}"/>
<Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}"/>
</Style>
<!-- 按钮样式 -->
<Style TargetType="Button">
<Setter Property="FontSize" Value="{StaticResource DefaultFontSize}"/>
<Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}"/>
<Setter Property="Padding" Value="8,4"/>
<Setter Property="MinHeight" Value="30"/>
</Style>
<!-- GroupBox样式 -->
<Style TargetType="GroupBox">
<Setter Property="FontSize" Value="{StaticResource LargeFontSize}"/>
<Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Margin" Value="8"/>
<Setter Property="Padding" Value="8"/>
</Style>
<!-- TextBox样式 -->
<Style TargetType="TextBox">
<Setter Property="FontSize" Value="{StaticResource DefaultFontSize}"/>
<Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}"/>
<Setter Property="Padding" Value="8"/>
</Style>
<!-- 代码TextBox样式用于钻带内容显示 -->
<Style x:Key="CodeTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="FontFamily" Value="{StaticResource CodeFontFamily}"/>
<Setter Property="FontSize" Value="{StaticResource CodeFontSize}"/>
</Style>
<!-- ListView样式 -->
<Style TargetType="ListView">
<Setter Property="FontSize" Value="{StaticResource DefaultFontSize}"/>
<Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}"/>
</Style>
<!-- ListViewItem样式 -->
<Style TargetType="ListViewItem">
<Setter Property="FontSize" Value="{StaticResource DefaultFontSize}"/>
<Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Padding" Value="8,4"/>
<Setter Property="MinHeight" Value="30"/>
</Style>
<!-- ToolBar样式 -->
<Style TargetType="ToolBar">
<Setter Property="FontSize" Value="{StaticResource DefaultFontSize}"/>
<Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}"/>
</Style>
<!-- StatusBar样式 -->
<Style TargetType="StatusBar">
<Setter Property="FontSize" Value="{StaticResource SmallFontSize}"/>
<Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}"/>
</Style>
<!-- StatusBarItem样式 -->
<Style TargetType="StatusBarItem">
<Setter Property="FontSize" Value="{StaticResource SmallFontSize}"/>
<Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}"/>
</Style>
</Application.Resources>
</Application>