Files
SzmediTools/Szmedi.RevitToolkit.Approval/SZMEDIResources.xaml

143 lines
10 KiB
Plaintext
Raw Normal View History

2025-09-19 09:18:09 +08:00
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Szmedi.RevitToolkit.Approval.Controls"
xmlns:converters="clr-namespace:Szmedi.RevitToolkit.Approval.Converters"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
2025-09-16 16:06:41 +08:00
<!-- <materialDesign:BundledTheme BaseTheme="Dark" PrimaryColor="Teal" SecondaryColor="Green" /> -->
<ResourceDictionary.MergedDictionaries>
2025-09-19 09:18:09 +08:00
<!-- Set your base theme -->
2025-09-16 16:06:41 +08:00
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml" />
2025-09-19 09:18:09 +08:00
<!-- Set your control styles -->
2025-09-16 16:06:41 +08:00
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/MaterialDesignColor.Green.Primary.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign3.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/Szmedi.RevitToolkit.Approval;component/Controls/MaterialWindow.xaml" />
<!-- <materialDesign:BundledTheme BaseTheme="Dark" PrimaryColor="Teal" SecondaryColor="Green" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign3.Defaults.xaml" />
2025-09-19 09:18:09 +08:00
<ResourceDictionary Source="pack://application:,,,/Szmedi.RevitToolkit.Approval;component/Controls/MaterialWindow.xaml" />-->
<!-- primary color -->
2025-09-16 16:06:41 +08:00
<ResourceDictionary>
2025-09-19 09:18:09 +08:00
<!-- include your primary palette -->
2025-09-16 16:06:41 +08:00
<ResourceDictionary.MergedDictionaries />
<Color x:Key="SZMCColor">#1F9944</Color>
<SolidColorBrush x:Key="SZMCBrush" Color="{StaticResource SZMCColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Light" Color="{StaticResource Primary200}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Light.Foreground" Color="{StaticResource Primary200Foreground}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary" Color="{StaticResource Primary500}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Foreground" Color="{StaticResource Primary500Foreground}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Dark" Color="{StaticResource Primary700}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Dark.Foreground" Color="{StaticResource Primary700Foreground}" />
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<converters:IntToBooleanConverter x:Key="IntToBooleanConverter" />
2025-09-19 09:18:09 +08:00
<!--<FontFamily x:Key="SourceHanSansSC">pack://application:,,,/Szmedi.RevitToolkit.Approval;component/Fonts/#Source Han Sans SC</FontFamily>-->
2025-09-16 16:06:41 +08:00
<Style x:Key="ExpanderStyle" TargetType="Expander">
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Background}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Expander}">
<DockPanel LastChildFill="True">
2025-09-19 09:18:09 +08:00
<ToggleButton
ClickMode="Press"
Content="{TemplateBinding Header}"
DockPanel.Dock="Top"
Foreground="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"
IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}"
Style="{StaticResource MaterialDesignHorizontalHeaderStyle}" />
<Rectangle
Height="1"
HorizontalAlignment="Stretch"
DockPanel.Dock="Top"
Fill="{StaticResource SZMCBrush}" />
<Border
Name="ContentSite"
Margin="10"
Visibility="Collapsed">
2025-09-16 16:06:41 +08:00
<ContentPresenter />
</Border>
</DockPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="True">
<Setter TargetName="ContentSite" Property="Visibility" Value="Visible" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="GroupHeaderStyle" TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
2025-09-19 09:18:09 +08:00
<Expander
Header="{Binding Name}"
IsExpanded="False"
Style="{StaticResource ExpanderStyle}">
2025-09-16 16:06:41 +08:00
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DrawingImage x:Key="Logo">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V1024 H1024 V0 H0 Z">
<DrawingGroup.Transform>
<TranslateTransform X="0" Y="5.8161029301118106E-05" />
</DrawingGroup.Transform>
<GeometryDrawing Brush="WhiteSmoke" Geometry="F1 M1024,1024z M0,0z M510.165334,556.416195C494.378674,556.416195,478.805347,557.226861,463.402687,558.762861L463.402687,465.280233A476.287802,476.287802,0,0,0,556.927981,465.280233L556.927981,558.720194C541.567987,557.226861,525.909327,556.416195,510.122667,556.416195z M701.823921,597.418844L701.823921,426.581582A467.626472,467.626472,0,0,0,977.621139,1.877759A1.877333,1.877333,0,0,0,975.743807,0.000427L834.517199,0.000427A1.877333,1.877333,0,0,0,832.7252,1.877759A322.133199,322.133199,0,0,1,701.866588,259.498985L701.866588,1.877759A1.877333,1.877333,0,0,0,699.946588,0.000427L558.719981,0.000427A1.877333,1.877333,0,0,0,556.885315,1.877759L556.885315,319.232294A324.309198,324.309198,0,0,1,463.36002,319.232294L463.36002,1.920426A1.834666,1.834666,0,0,0,461.568021,0.000427L320.341413,0.000427A1.877333,1.877333,0,0,0,318.506747,1.877759L318.506747,259.541652A322.133199,322.133199,0,0,1,187.562802,1.835093A1.877333,1.877333,0,0,0,185.728136,0.000427L44.544195,0.000427A1.877333,1.877333,0,0,0,42.666862,1.877759A467.626472,467.626472,0,0,0,318.506747,426.666916L318.506747,597.333511A467.626472,467.626472,0,0,0,42.666862,1022.122667C42.666862,1023.146667,43.520195,1024,44.544195,1024L185.770803,1024C186.752136,1024,187.562802,1023.146667,187.562802,1022.122667A322.133199,322.133199,0,0,1,318.549414,764.458775L318.549414,1022.122667C318.549414,1023.146667,319.36008,1024,320.38408,1024L461.568021,1024C462.592021,1024,463.402687,1023.146667,463.402687,1022.122667L463.402687,704.725466A325.717198,325.717198,0,0,1,556.927981,704.725466L556.927981,1022.122667C556.927981,1023.146667,557.781314,1024,558.805314,1024L699.989255,1024C701.013255,1024,701.823921,1023.146667,701.823921,1022.122667L701.823921,764.501441A322.133199,322.133199,0,0,1,832.7252,1022.122667C832.7252,1023.189333,833.535866,1024,834.559866,1024L975.743807,1024C976.767807,1024,977.62114,1023.146667,977.621139,1022.122667A467.626472,467.626472,0,0,0,701.866588,597.418844z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
2025-09-19 09:18:09 +08:00
<!-- BasedOn="{StaticResource MaterialWindowStyle}" -->
<Style
x:Key="SZMEDIWindowStyle"
BasedOn="{StaticResource MaterialWindowStyle}"
TargetType="{x:Type controls:MaterialWindow}">
<!--<Setter Property="FontFamily" Value="{StaticResource SourceHanSansSC}" />-->
2025-09-16 16:06:41 +08:00
<Setter Property="FontSize" Value="14" />
<Setter Property="Icon" Value="{StaticResource Logo}" />
</Style>
<Style BasedOn="{StaticResource MaterialDesignRaisedDarkButton}" TargetType="{x:Type Button}">
2025-09-19 09:18:09 +08:00
<Setter Property="BorderThickness" Value="0" />
<!-- <Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="{StaticResource SZMCBrush}" />-->
2025-09-16 16:06:41 +08:00
</Style>
<Style BasedOn="{StaticResource MaterialDesignCardGroupBox}" TargetType="{x:Type GroupBox}">
<!--<Setter Property="TextElement.Foreground" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />-->
2025-09-19 09:18:09 +08:00
<!--<Setter Property="Background" Value="{StaticResource SZMCBrush}" />-->
2025-09-16 16:06:41 +08:00
</Style>
<Style TargetType="DataGridCell">
<Setter Property="MinHeight" Value="40" />
<Setter Property="VerticalContentAlignment" Value="Center" />
2025-09-19 09:18:09 +08:00
<!-- 确保 TextBlock 也垂直居中(如果列内容是 TextBlock -->
2025-09-16 16:06:41 +08:00
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<Grid Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource MaterialDesignDataGrid}" TargetType="{x:Type DataGrid}">
<Setter Property="AutoGenerateColumns" Value="False" />
<Setter Property="CanUserAddRows" Value="False" />
<Setter Property="GridLinesVisibility" Value="Horizontal" />
</Style>
<Style BasedOn="{StaticResource MaterialDesignOutlinedComboBox}" TargetType="ComboBox">
2025-09-19 09:18:09 +08:00
<Setter Property="Padding" Value="8" />
2025-09-16 16:06:41 +08:00
</Style>
<Style BasedOn="{StaticResource MaterialDesignOutlinedTextBox}" TargetType="TextBox">
2025-09-19 09:18:09 +08:00
<Setter Property="Padding" Value="8" />
2025-09-16 16:06:41 +08:00
</Style>
</ResourceDictionary>