优化更新代码,添加界面功能并整合
This commit is contained in:
35
WPFluent/Controls/MessageBox/MessageBoxIconExtensions.cs
Normal file
35
WPFluent/Controls/MessageBox/MessageBoxIconExtensions.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
namespace WPFluent.Controls;
|
||||
|
||||
public static class MessageBoxIconExtensions
|
||||
{
|
||||
public static MessageBoxIcon ToMessageBoxIcon(this IconSource icon)
|
||||
{
|
||||
MessageBoxIcon boxIcon = MessageBoxIcon.None;
|
||||
|
||||
if (icon is FontIconSource ficon)
|
||||
{
|
||||
if (ficon.Glyph == MessageBoxSymbolGlyph.Error.ToGlyph())
|
||||
{
|
||||
boxIcon = MessageBoxIcon.Error;
|
||||
}
|
||||
else if (ficon.Glyph == MessageBoxSymbolGlyph.Info.ToGlyph())
|
||||
{
|
||||
boxIcon = MessageBoxIcon.Information;
|
||||
}
|
||||
else if (ficon.Glyph == MessageBoxSymbolGlyph.Warning.ToGlyph())
|
||||
{
|
||||
boxIcon = MessageBoxIcon.Warning;
|
||||
}
|
||||
else if (ficon.Glyph == MessageBoxSymbolGlyph.Question.ToGlyph())
|
||||
{
|
||||
boxIcon = MessageBoxIcon.Question;
|
||||
}
|
||||
else if (ficon.Glyph == MessageBoxSymbolGlyph.None.ToGlyph())
|
||||
{
|
||||
boxIcon = MessageBoxIcon.None;
|
||||
}
|
||||
}
|
||||
return boxIcon;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user