fixed an issue where resources could not be found in growl & messagebox
This commit is contained in:
1 parent
2aff85c4e2
commit
7c0a551d69
6 files changed
+24
-11
No files matched your search
+3
-3
@@ -2,19 +2,19 @@
|
|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>HandyControl</id>
|
<id>HandyControl</id>
|
||||||
<version>3.1.0</version>
|
<version>3.2.0</version>
|
||||||
<title>HandyOrg</title>
|
<title>HandyOrg</title>
|
||||||
<authors>HandyOrg</authors>
|
<authors>HandyOrg</authors>
|
||||||
<owners>HandyOrg</owners>
|
<owners>HandyOrg</owners>
|
||||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||||
<license type="file">LICENSE</license>
|
<license type="file">LICENSE</license>
|
||||||
<icon>icon.png</icon>
|
<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>
|
<description>Contains some simple and commonly used WPF controls</description>
|
||||||
<releaseNotes>Changes are detailed at https://github.com/HandyOrg/HandyControl/releases</releaseNotes>
|
<releaseNotes>Changes are detailed at https://github.com/HandyOrg/HandyControl/releases</releaseNotes>
|
||||||
<copyright>Copyright © HandyOrg 2018-2021</copyright>
|
<copyright>Copyright © HandyOrg 2018-2021</copyright>
|
||||||
<tags>WPF C# Control</tags>
|
<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>
|
<dependencies>
|
||||||
<group targetFramework=".NETFramework4.0" />
|
<group targetFramework=".NETFramework4.0" />
|
||||||
<group targetFramework=".NETFramework4.5" />
|
<group targetFramework=".NETFramework4.5" />
|
||||||
|
|||||||
@@ -372,8 +372,8 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
Message = growlInfo.Message,
|
Message = growlInfo.Message,
|
||||||
Time = DateTime.Now,
|
Time = DateTime.Now,
|
||||||
Icon = ResourceHelper.GetResourceInternal<Geometry>(growlInfo.IconKey),
|
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey) ?? growlInfo.Icon,
|
||||||
IconBrush = ResourceHelper.GetResourceInternal<Brush>(growlInfo.IconBrushKey),
|
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey) ?? growlInfo.IconBrush,
|
||||||
_showCloseButton = growlInfo.ShowCloseButton,
|
_showCloseButton = growlInfo.ShowCloseButton,
|
||||||
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
||||||
_staysOpen = growlInfo.StaysOpen,
|
_staysOpen = growlInfo.StaysOpen,
|
||||||
@@ -408,8 +408,8 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
Message = growlInfo.Message,
|
Message = growlInfo.Message,
|
||||||
Time = DateTime.Now,
|
Time = DateTime.Now,
|
||||||
Icon = ResourceHelper.GetResourceInternal<Geometry>(growlInfo.IconKey),
|
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey) ?? growlInfo.Icon,
|
||||||
IconBrush = ResourceHelper.GetResourceInternal<Brush>(growlInfo.IconBrushKey),
|
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey) ?? growlInfo.IconBrush,
|
||||||
_showCloseButton = growlInfo.ShowCloseButton,
|
_showCloseButton = growlInfo.ShowCloseButton,
|
||||||
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
||||||
_staysOpen = growlInfo.StaysOpen,
|
_staysOpen = growlInfo.StaysOpen,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using HandyControl.Data;
|
||||||
using HandyControl.Tools;
|
using HandyControl.Tools;
|
||||||
|
|
||||||
namespace HandyControl.Controls
|
namespace HandyControl.Controls
|
||||||
@@ -45,7 +46,7 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
Stretch = Stretch.UniformToFill
|
Stretch = Stretch.UniformToFill
|
||||||
}
|
}
|
||||||
: ResourceHelper.GetResourceInternal<Brush>("SecondaryRegionBrush");
|
: ResourceHelper.GetResourceInternal<Brush>(ResourceToken.SecondaryRegionBrush);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageSource Source
|
public ImageSource Source
|
||||||
|
|||||||
@@ -375,13 +375,13 @@ namespace HandyControl.Controls
|
|||||||
if (!string.IsNullOrEmpty(info.IconKey))
|
if (!string.IsNullOrEmpty(info.IconKey))
|
||||||
{
|
{
|
||||||
messageBox.ShowImage = true;
|
messageBox.ShowImage = true;
|
||||||
messageBox.Image = ResourceHelper.GetResourceInternal<Geometry>(info.IconKey);
|
messageBox.Image = ResourceHelper.GetResource<Geometry>(info.IconKey) ?? info.Icon;
|
||||||
messageBox.ImageBrush = ResourceHelper.GetResourceInternal<Brush>(info.IconBrushKey);
|
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(info.IconBrushKey) ?? info.IconBrush;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.StyleKey != null)
|
if (info.StyleKey != null)
|
||||||
{
|
{
|
||||||
messageBox.Style = ResourceHelper.GetResourceInternal<Style>(info.StyleKey);
|
messageBox.Style = ResourceHelper.GetResource<Style>(info.StyleKey) ?? info.Style;
|
||||||
}
|
}
|
||||||
SystemSounds.Asterisk.Play();
|
SystemSounds.Asterisk.Play();
|
||||||
messageBox.ShowDialog();
|
messageBox.ShowDialog();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace HandyControl.Data
|
namespace HandyControl.Data
|
||||||
{
|
{
|
||||||
@@ -23,8 +24,12 @@ namespace HandyControl.Data
|
|||||||
|
|
||||||
public InfoType Type { get; set; }
|
public InfoType Type { get; set; }
|
||||||
|
|
||||||
|
public Geometry Icon { get; set; }
|
||||||
|
|
||||||
public string IconKey { get; set; }
|
public string IconKey { get; set; }
|
||||||
|
|
||||||
|
public Brush IconBrush { get; set; }
|
||||||
|
|
||||||
public string IconBrushKey { get; set; }
|
public string IconBrushKey { get; set; }
|
||||||
|
|
||||||
public bool ShowCloseButton { get; set; } = true;
|
public bool ShowCloseButton { get; set; } = true;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace HandyControl.Data
|
namespace HandyControl.Data
|
||||||
{
|
{
|
||||||
@@ -10,12 +11,18 @@ namespace HandyControl.Data
|
|||||||
|
|
||||||
public MessageBoxButton Button { get; set; } = MessageBoxButton.OK;
|
public MessageBoxButton Button { get; set; } = MessageBoxButton.OK;
|
||||||
|
|
||||||
|
public Geometry Icon { get; set; }
|
||||||
|
|
||||||
public string IconKey { get; set; }
|
public string IconKey { get; set; }
|
||||||
|
|
||||||
|
public Brush IconBrush { get; set; }
|
||||||
|
|
||||||
public string IconBrushKey { get; set; }
|
public string IconBrushKey { get; set; }
|
||||||
|
|
||||||
public MessageBoxResult DefaultResult { get; set; } = MessageBoxResult.None;
|
public MessageBoxResult DefaultResult { get; set; } = MessageBoxResult.None;
|
||||||
|
|
||||||
|
public Style Style { get; set; }
|
||||||
|
|
||||||
public string StyleKey { get; set; }
|
public string StyleKey { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user