Merge branch 'master' into patch-1
This commit is contained in:
4 files changed
+72
-50
No files matched your search
@@ -353,28 +353,28 @@ namespace HandyControl.Controls
|
|||||||
new Action(
|
new Action(
|
||||||
#endif
|
#endif
|
||||||
() =>
|
() =>
|
||||||
|
{
|
||||||
|
var ctl = new Growl
|
||||||
{
|
{
|
||||||
var ctl = new Growl
|
Message = growlInfo.Message,
|
||||||
{
|
Time = DateTime.Now,
|
||||||
Message = growlInfo.Message,
|
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey),
|
||||||
Time = DateTime.Now,
|
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey),
|
||||||
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey),
|
_showCloseButton = growlInfo.ShowCloseButton,
|
||||||
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey),
|
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
||||||
_showCloseButton = growlInfo.ShowCloseButton,
|
_staysOpen = growlInfo.StaysOpen,
|
||||||
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
ShowDateTime = growlInfo.ShowDateTime,
|
||||||
_staysOpen = growlInfo.StaysOpen,
|
ConfirmStr = growlInfo.ConfirmStr,
|
||||||
ShowDateTime = growlInfo.ShowDateTime,
|
CancelStr = growlInfo.CancelStr,
|
||||||
ConfirmStr = growlInfo.ConfirmStr,
|
Type = growlInfo.Type,
|
||||||
CancelStr = growlInfo.CancelStr,
|
_waitTime = Math.Max(growlInfo.WaitTime, 2)
|
||||||
Type = growlInfo.Type,
|
};
|
||||||
_waitTime = Math.Max(growlInfo.WaitTime, 2)
|
GrowlWindow.GrowlPanel.Children.Insert(0, ctl);
|
||||||
};
|
}
|
||||||
GrowlWindow.GrowlPanel.Children.Insert(0, ctl);
|
|
||||||
}
|
|
||||||
#if NET40
|
#if NET40
|
||||||
)
|
)
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -388,38 +388,38 @@ namespace HandyControl.Controls
|
|||||||
new Action(
|
new Action(
|
||||||
#endif
|
#endif
|
||||||
() =>
|
() =>
|
||||||
|
{
|
||||||
|
var ctl = new Growl
|
||||||
{
|
{
|
||||||
var ctl = new Growl
|
Message = growlInfo.Message,
|
||||||
|
Time = DateTime.Now,
|
||||||
|
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey),
|
||||||
|
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey),
|
||||||
|
_showCloseButton = growlInfo.ShowCloseButton,
|
||||||
|
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
||||||
|
_staysOpen = growlInfo.StaysOpen,
|
||||||
|
ShowDateTime = growlInfo.ShowDateTime,
|
||||||
|
ConfirmStr = growlInfo.ConfirmStr,
|
||||||
|
CancelStr = growlInfo.CancelStr,
|
||||||
|
Type = growlInfo.Type,
|
||||||
|
_waitTime = Math.Max(growlInfo.WaitTime, 2)
|
||||||
|
};
|
||||||
|
if (!string.IsNullOrEmpty(growlInfo.Token))
|
||||||
|
{
|
||||||
|
if (PanelDic.TryGetValue(growlInfo.Token, out var panel))
|
||||||
{
|
{
|
||||||
Message = growlInfo.Message,
|
panel?.Children.Insert(0, ctl);
|
||||||
Time = DateTime.Now,
|
|
||||||
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey),
|
|
||||||
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey),
|
|
||||||
_showCloseButton = growlInfo.ShowCloseButton,
|
|
||||||
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
|
||||||
_staysOpen = growlInfo.StaysOpen,
|
|
||||||
ShowDateTime = growlInfo.ShowDateTime,
|
|
||||||
ConfirmStr = growlInfo.ConfirmStr,
|
|
||||||
CancelStr = growlInfo.CancelStr,
|
|
||||||
Type = growlInfo.Type,
|
|
||||||
_waitTime = Math.Max(growlInfo.WaitTime, 2)
|
|
||||||
};
|
|
||||||
if (!string.IsNullOrEmpty(growlInfo.Token))
|
|
||||||
{
|
|
||||||
if (PanelDic.TryGetValue(growlInfo.Token, out var panel))
|
|
||||||
{
|
|
||||||
panel?.Children.Insert(0, ctl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GrowlPanel?.Children.Insert(0, ctl);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GrowlPanel?.Children.Insert(0, ctl);
|
||||||
|
}
|
||||||
|
}
|
||||||
#if NET40
|
#if NET40
|
||||||
)
|
)
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void InitGrowlInfo(ref GrowlInfo growlInfo, InfoType infoType)
|
private static void InitGrowlInfo(ref GrowlInfo growlInfo, InfoType infoType)
|
||||||
@@ -485,7 +485,18 @@ namespace HandyControl.Controls
|
|||||||
growlInfo.IconBrushKey = ResourceToken.PrimaryTextBrush;
|
growlInfo.IconBrushKey = ResourceToken.PrimaryTextBrush;
|
||||||
growlInfo.StaysOpen = true;
|
growlInfo.StaysOpen = true;
|
||||||
growlInfo.ShowCloseButton = false;
|
growlInfo.ShowCloseButton = false;
|
||||||
if (GrowlPanel.ContextMenu != null) GrowlPanel.ContextMenu.Opacity = 0;
|
Application.Current.Dispatcher?.Invoke(
|
||||||
|
#if NET40
|
||||||
|
new Action(
|
||||||
|
#endif
|
||||||
|
() =>
|
||||||
|
{
|
||||||
|
if (GrowlPanel.ContextMenu != null) GrowlPanel.ContextMenu.Opacity = 0;
|
||||||
|
}
|
||||||
|
#if NET40
|
||||||
|
)
|
||||||
|
#endif
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
<!--region Button-->
|
<!--region Button-->
|
||||||
|
|
||||||
<Style BasedOn="{StaticResource ButtonBaseStyle}" TargetType="Button">
|
<Style x:Key="ButtonDefault" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="Button">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1" />
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
|
||||||
@@ -23,6 +23,8 @@
|
|||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style BasedOn="{StaticResource ButtonDefault}" TargetType="Button"/>
|
||||||
|
|
||||||
<Style x:Key="ButtonPrimary" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="Button">
|
<Style x:Key="ButtonPrimary" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="Button">
|
||||||
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<!--region RepeatButton-->
|
<!--region RepeatButton-->
|
||||||
|
|
||||||
<Style BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
|
<Style x:Key="RepeatButtonDefault" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
@@ -22,18 +22,25 @@
|
|||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style BasedOn="{StaticResource RepeatButtonDefault}" TargetType="RepeatButton"/>
|
||||||
|
|
||||||
<Style x:Key="RepeatButtonPrimary" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
|
<Style x:Key="RepeatButtonPrimary" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
|
||||||
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="RepeatButtonSuccess" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
|
<Style x:Key="RepeatButtonSuccess" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
|
||||||
<Setter Property="Background" Value="{DynamicResource SuccessBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource SuccessBrush}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="RepeatButtonInfo" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
|
<Style x:Key="RepeatButtonInfo" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
|
||||||
<Setter Property="Background" Value="{DynamicResource InfoBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource InfoBrush}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="RepeatButtonWarning" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
|
<Style x:Key="RepeatButtonWarning" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
|
||||||
<Setter Property="Background" Value="{DynamicResource WarningBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource WarningBrush}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="RepeatButtonDanger" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
|
<Style x:Key="RepeatButtonDanger" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
|
||||||
<Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
<!--普通-->
|
<!--普通-->
|
||||||
<Style BasedOn="{StaticResource ToggleButtonBaseStyle}" TargetType="ToggleButton">
|
<Style x:Key="ToggleButtonDefault" BasedOn="{StaticResource ToggleButtonBaseStyle}" TargetType="ToggleButton">
|
||||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
@@ -23,6 +23,8 @@
|
|||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style BasedOn="{StaticResource ToggleButtonDefault}" TargetType="ToggleButton"/>
|
||||||
|
|
||||||
<Style x:Key="ToggleButtonPrimary" BasedOn="{StaticResource ToggleButtonBaseStyle}" TargetType="ToggleButton">
|
<Style x:Key="ToggleButtonPrimary" BasedOn="{StaticResource ToggleButtonBaseStyle}" TargetType="ToggleButton">
|
||||||
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
Reference in new issue
Block a user