修改部分bug
This commit is contained in:
1 parent
499379e20b
commit
3135189ea3
18 files changed
+184
-364
No files matched your search
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace Store.Management.Framework.Controls.Attach;
|
||||
|
||||
/// <summary>
|
||||
/// 弹出窗口属性值
|
||||
/// </summary>
|
||||
public class DialogWindowProperty
|
||||
{
|
||||
public static readonly DependencyProperty WindowStartupLocationProperty = DependencyProperty.RegisterAttached(
|
||||
"WindowStartupLocation", typeof(WindowStartupLocation), typeof(DialogWindowProperty), new PropertyMetadata(WindowStartupLocation.CenterScreen));
|
||||
public static void SetWindowStartupLocation(DependencyObject element, WindowStartupLocation value)
|
||||
=> element.SetValue(WindowStartupLocationProperty, value);
|
||||
public static WindowStartupLocation GetWindowStartupLocation(DependencyObject element)
|
||||
=> (WindowStartupLocation)element.GetValue(WindowStartupLocationProperty);
|
||||
|
||||
|
||||
public static readonly DependencyProperty ResizeModeProperty = DependencyProperty.RegisterAttached(
|
||||
"ResizeMode", typeof(ResizeMode), typeof(DialogWindowProperty), new PropertyMetadata(ResizeMode.CanResize));
|
||||
public static void SetResizeMode(DependencyObject element, ResizeMode value)
|
||||
=> element.SetValue(ResizeModeProperty, value);
|
||||
public static ResizeMode GetResizeMode(DependencyObject element)
|
||||
=> (ResizeMode)element.GetValue(ResizeModeProperty);
|
||||
|
||||
|
||||
|
||||
public static readonly DependencyProperty WidthProperty = DependencyProperty.RegisterAttached(
|
||||
"Width", typeof(double), typeof(DialogWindowProperty), new PropertyMetadata(double.NaN));
|
||||
public static void SetWidth(DependencyObject element, double value)
|
||||
=> element.SetValue(WidthProperty, value);
|
||||
public static double GetWidth(DependencyObject element)
|
||||
=> (double)element.GetValue(WidthProperty);
|
||||
|
||||
|
||||
|
||||
public static readonly DependencyProperty HeightProperty = DependencyProperty.RegisterAttached(
|
||||
"Height", typeof(double), typeof(DialogWindowProperty), new PropertyMetadata(double.NaN));
|
||||
public static void SetHeight(DependencyObject element, double value)
|
||||
=> element.SetValue(HeightProperty, value);
|
||||
public static double GetHeight(DependencyObject element)
|
||||
=> (double)element.GetValue(HeightProperty);
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
<local:WindowBase x:Class="Store.Management.Framework.Controls.DialogWindow"
|
||||
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:local="clr-namespace:Store.Management.Framework.Controls"
|
||||
mc:Ignorable="d"
|
||||
Title="DialogWindow" Height="450" Width="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
<local:WindowBase
|
||||
x:Class="Store.Management.Framework.Controls.DialogWindow"
|
||||
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:Store.Management.Framework.Controls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="DialogWindow"
|
||||
Width="800"
|
||||
Height="450"
|
||||
mc:Ignorable="d">
|
||||
<Grid />
|
||||
</local:WindowBase>
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
using MAX.Framework.Controls;
|
||||
using MAX.Framework.Controls.Attach;
|
||||
using Prism.Services.Dialogs;
|
||||
using Store.Management.Framework.Controls;
|
||||
using Store.Management.Framework.Controls.Attach;
|
||||
@@ -91,6 +89,8 @@ public partial class DialogWindow : WindowBase, IDialogWindow
|
||||
if (newContent is UserControl control)
|
||||
{
|
||||
|
||||
WindowStartupLocation = DialogWindowProperty.GetWindowStartupLocation(control);
|
||||
|
||||
Setter widthSetter = this.Style.Setters.OfType<Setter>().FirstOrDefault(a => a.Property == WidthProperty);
|
||||
if (widthSetter == null)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Color x:Key="LightPrimaryColor">#F4EDF3</Color>
|
||||
<Color x:Key="PrimaryColor">#98638F</Color>
|
||||
<Color x:Key="DarkPrimaryColor">#784B70</Color>
|
||||
|
||||
<Color x:Key="LightDangerColor">#FBEFF0</Color>
|
||||
<Color x:Key="DangerColor">#C35C64</Color>
|
||||
<Color x:Key="DarkDangerColor">#A34A52</Color>
|
||||
|
||||
<Color x:Key="LightWarningColor">#FBF4E7</Color>
|
||||
<Color x:Key="WarningColor">#A77725</Color>
|
||||
<Color x:Key="DarkWarningColor">#855D1B</Color>
|
||||
|
||||
<Color x:Key="LightInfoColor">#F0F2F4</Color>
|
||||
<Color x:Key="InfoColor">#69727D</Color>
|
||||
<Color x:Key="DarkInfoColor">#59616B</Color>
|
||||
|
||||
<Color x:Key="LightSuccessColor">#EAF5F0</Color>
|
||||
<Color x:Key="SuccessColor">#31856A</Color>
|
||||
<Color x:Key="DarkSuccessColor">#276B55</Color>
|
||||
|
||||
<Color x:Key="PrimaryTextColor">#292731</Color>
|
||||
<Color x:Key="SecondaryTextColor">#7C838C</Color>
|
||||
<Color x:Key="ThirdlyTextColor">#A0A6AD</Color>
|
||||
<Color x:Key="ReverseTextColor">#FFFFFF</Color>
|
||||
<Color x:Key="TextIconColor">#FFFFFF</Color>
|
||||
|
||||
<Color x:Key="BorderColor">#E5E7EB</Color>
|
||||
<Color x:Key="SecondaryBorderColor">#D1D5DB</Color>
|
||||
<Color x:Key="BackgroundColor">#F5F6F7</Color>
|
||||
<Color x:Key="RegionColor">#FFFFFF</Color>
|
||||
<Color x:Key="SecondaryRegionColor">#F0F2F4</Color>
|
||||
<Color x:Key="ThirdlyRegionColor">#FAFBFC</Color>
|
||||
<Color x:Key="TitleColor">#98638F</Color>
|
||||
<Color x:Key="SecondaryTitleColor">#784B70</Color>
|
||||
|
||||
<Color x:Key="DefaultColor">#FFFFFF</Color>
|
||||
<Color x:Key="DarkDefaultColor">#F0F2F4</Color>
|
||||
|
||||
<Color x:Key="AccentColor">#98638F</Color>
|
||||
<Color x:Key="DarkAccentColor">#784B70</Color>
|
||||
|
||||
<Color x:Key="DarkMaskColor">#20000000</Color>
|
||||
<Color x:Key="DarkOpacityColor">#40000000</Color>
|
||||
|
||||
<SolidColorBrush x:Key="TreeViewItemSelectedBrush" Color="#F3EAF1" />
|
||||
<SolidColorBrush x:Key="TreeViewItemSelectedBrush2" Color="#784B70" />
|
||||
|
||||
<Color x:Key="BackgrondColor1">#F7F8F9</Color>
|
||||
<Color x:Key="BackgrondColor2">#F0F2F4</Color>
|
||||
<Color x:Key="BackgrondColor3">#E5E7EB</Color>
|
||||
<Color x:Key="BackgrondColor4">#D1D5DB</Color>
|
||||
|
||||
<SolidColorBrush x:Key="Background1" Color="{StaticResource BackgrondColor1}" />
|
||||
<SolidColorBrush x:Key="Background2" Color="{StaticResource BackgrondColor2}" />
|
||||
<SolidColorBrush x:Key="Background3" Color="{StaticResource BackgrondColor3}" />
|
||||
<SolidColorBrush x:Key="Background4" Color="{StaticResource BackgrondColor4}" />
|
||||
|
||||
<Color x:Key="FunctionTypeColor">#98638F</Color>
|
||||
<Color x:Key="VariableTypeColor">#31856A</Color>
|
||||
<Color x:Key="ConstTypeColor">#A77725</Color>
|
||||
|
||||
<SolidColorBrush x:Key="FunctionTypeBrush" Color="{StaticResource FunctionTypeColor}" />
|
||||
<SolidColorBrush x:Key="VariableTypeBrush" Color="{StaticResource VariableTypeColor}" />
|
||||
<SolidColorBrush x:Key="ConstTypeBrush" Color="{StaticResource ConstTypeColor}" />
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,6 +1,27 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:f="clr-namespace:Store.Management.Framework.Controls">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/Store.Management.Framework;component/Controls/DataGridEx/DataGridEx.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style
|
||||
x:Key="WindowBase"
|
||||
BasedOn="{StaticResource WindowWin10}"
|
||||
TargetType="f:WindowBase">
|
||||
<Setter Property="Background" Value="White" />
|
||||
</Style>
|
||||
<Style
|
||||
x:Key="DialogWindowStyle"
|
||||
BasedOn="{StaticResource WindowBase}"
|
||||
TargetType="f:DialogWindow">
|
||||
<Setter Property="Tag" Value="Default" />
|
||||
<Setter Property="ResizeMode" Value="NoResize" />
|
||||
<Setter Property="ShowInTaskbar" Value="False" />
|
||||
<Setter Property="WindowChrome.GlassFrameThickness" Value="-1" />
|
||||
</Style>
|
||||
<Style BasedOn="{StaticResource WindowBase}" TargetType="f:WindowBase" />
|
||||
<Style BasedOn="{StaticResource DialogWindowStyle}" TargetType="f:DialogWindow" />
|
||||
</ResourceDictionary>
|
||||
@@ -1,5 +0,0 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/Store.Management.Framework;component/Controls/DataGridEx/DataGridEx.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
Reference in new issue
Block a user