fixed an issue where resources could not be found in growl & messagebox

This commit is contained in:
NaBian committed 2021-06-29 22:09:33 +08:00
1 parent 2aff85c4e2
commit 7c0a551d69
6 files changed
+24 -11

No files matched your search

+3 -3
View File
@@ -2,19 +2,19 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>HandyControl</id>
<version>3.1.0</version>
<version>3.2.0</version>
<title>HandyOrg</title>
<authors>HandyOrg</authors>
<owners>HandyOrg</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<license type="file">LICENSE</license>
<icon>icon.png</icon>
<projectUrl>https://github.com/NaBian/HandyControl</projectUrl>
<projectUrl>https://github.com/HandyOrg/HandyControl</projectUrl>
<description>Contains some simple and commonly used WPF controls</description>
<releaseNotes>Changes are detailed at https://github.com/HandyOrg/HandyControl/releases</releaseNotes>
<copyright>Copyright © HandyOrg 2018-2021</copyright>
<tags>WPF C# Control</tags>
<repository type="git" url="https://github.com/HandyOrg/HandyControl" commit="35bbccd5b86bcedcfe16886857343e719feaf173" />
<repository type="git" url="https://github.com/HandyOrg/HandyControl" commit="2aff85c4e2e903f9962899288dce92d27fda2a4c" />
<dependencies>
<group targetFramework=".NETFramework4.0" />
<group targetFramework=".NETFramework4.5" />
@@ -372,8 +372,8 @@ namespace HandyControl.Controls
{
Message = growlInfo.Message,
Time = DateTime.Now,
Icon = ResourceHelper.GetResourceInternal<Geometry>(growlInfo.IconKey),
IconBrush = ResourceHelper.GetResourceInternal<Brush>(growlInfo.IconBrushKey),
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey) ?? growlInfo.Icon,
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey) ?? growlInfo.IconBrush,
_showCloseButton = growlInfo.ShowCloseButton,
ActionBeforeClose = growlInfo.ActionBeforeClose,
_staysOpen = growlInfo.StaysOpen,
@@ -408,8 +408,8 @@ namespace HandyControl.Controls
{
Message = growlInfo.Message,
Time = DateTime.Now,
Icon = ResourceHelper.GetResourceInternal<Geometry>(growlInfo.IconKey),
IconBrush = ResourceHelper.GetResourceInternal<Brush>(growlInfo.IconBrushKey),
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey) ?? growlInfo.Icon,
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey) ?? growlInfo.IconBrush,
_showCloseButton = growlInfo.ShowCloseButton,
ActionBeforeClose = growlInfo.ActionBeforeClose,
_staysOpen = growlInfo.StaysOpen,
@@ -1,6 +1,7 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using HandyControl.Data;
using HandyControl.Tools;
namespace HandyControl.Controls
@@ -45,7 +46,7 @@ namespace HandyControl.Controls
{
Stretch = Stretch.UniformToFill
}
: ResourceHelper.GetResourceInternal<Brush>("SecondaryRegionBrush");
: ResourceHelper.GetResourceInternal<Brush>(ResourceToken.SecondaryRegionBrush);
}
public ImageSource Source
@@ -375,13 +375,13 @@ namespace HandyControl.Controls
if (!string.IsNullOrEmpty(info.IconKey))
{
messageBox.ShowImage = true;
messageBox.Image = ResourceHelper.GetResourceInternal<Geometry>(info.IconKey);
messageBox.ImageBrush = ResourceHelper.GetResourceInternal<Brush>(info.IconBrushKey);
messageBox.Image = ResourceHelper.GetResource<Geometry>(info.IconKey) ?? info.Icon;
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(info.IconBrushKey) ?? info.IconBrush;
}
if (info.StyleKey != null)
{
messageBox.Style = ResourceHelper.GetResourceInternal<Style>(info.StyleKey);
messageBox.Style = ResourceHelper.GetResource<Style>(info.StyleKey) ?? info.Style;
}
SystemSounds.Asterisk.Play();
messageBox.ShowDialog();
@@ -1,5 +1,6 @@
using System;
using System.Windows;
using System.Windows.Media;
namespace HandyControl.Data
{
@@ -23,8 +24,12 @@ namespace HandyControl.Data
public InfoType Type { get; set; }
public Geometry Icon { get; set; }
public string IconKey { get; set; }
public Brush IconBrush { get; set; }
public string IconBrushKey { get; set; }
public bool ShowCloseButton { get; set; } = true;
@@ -1,4 +1,5 @@
using System.Windows;
using System.Windows.Media;
namespace HandyControl.Data
{
@@ -10,12 +11,18 @@ namespace HandyControl.Data
public MessageBoxButton Button { get; set; } = MessageBoxButton.OK;
public Geometry Icon { get; set; }
public string IconKey { get; set; }
public Brush IconBrush { get; set; }
public string IconBrushKey { get; set; }
public MessageBoxResult DefaultResult { get; set; } = MessageBoxResult.None;
public Style Style { get; set; }
public string StyleKey { get; set; }
}
}