添加项目文件。

This commit is contained in:
GG Z
2024-09-22 11:05:41 +08:00
parent fb5d55723a
commit 49ceaae6a8
764 changed files with 78850 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:exc="clr-namespace:Wpf.Ui.Extend.Controls">
<Style x:Key="DefaultFluentWindowExStyle" TargetType="{x:Type exc:FluentWindowEx}">
<Setter Property="Background" Value="{DynamicResource WindowBackground}" />
<Setter Property="Foreground" Value="{DynamicResource WindowForeground}" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="MinWidth" Value="280" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type exc:FluentWindowEx}">
<DockPanel>
<controls:TitleBar
Title="{TemplateBinding Title}"
Background="{TemplateBinding Background}"
DockPanel.Dock="Top"
Icon="{TemplateBinding TitleIcon}" />
<AdornerDecorator>
<controls:ClientAreaBorder
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter x:Name="ContentPresenter" />
</controls:ClientAreaBorder>
</AdornerDecorator>
<!--<controls:SnackbarPresenter x:Name="SnackbarPresenter" DockPanel.Dock="Bottom" />-->
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultFluentWindowExStyle}" TargetType="{x:Type exc:FluentWindowEx}" />
</ResourceDictionary>

View File

@@ -0,0 +1,34 @@
using System.Windows;
using Wpf.Ui.Controls;
namespace Wpf.Ui.Extend.Controls;
public class FluentWindowEx : FluentWindow
{
static FluentWindowEx()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(FluentWindowEx), new FrameworkPropertyMetadata(typeof(FluentWindowEx)));
}
public FluentWindowEx()
{
//将指定的属性与资源字典中的资源关联起来
SetResourceReference(StyleProperty,typeof(FluentWindowEx));
}
public IconElement TitleIcon
{
get { return (IconElement)GetValue(TitleIconProperty); }
set { SetValue(TitleIconProperty, value); }
}
public static readonly DependencyProperty TitleIconProperty =
DependencyProperty.Register(nameof(TitleIcon), typeof(IconElement), typeof(FluentWindowEx), new PropertyMetadata(null));
//public override void OnApplyTemplate()
//{
// base.OnApplyTemplate();
// var resources = Application.Current.Resources;
// var style = Application.Current.FindResource("DefaultFluentWindowExStyle");
// var style1 = Application.Current.FindResource(typeof(FluentWindowEx));
// this.Style = (Style)FindResource(typeof(FluentWindowEx));
//}
}