清理引用,将NavigatorServices更改为使用Message来实现导航的切换
This commit is contained in:
@@ -2,10 +2,19 @@
|
||||
|
||||
namespace PMSWPF.Extensions;
|
||||
|
||||
class EnumBindingSourceExtension : MarkupExtension
|
||||
internal class EnumBindingSourceExtension : MarkupExtension
|
||||
{
|
||||
private Type? _enumType;
|
||||
|
||||
public EnumBindingSourceExtension()
|
||||
{
|
||||
}
|
||||
|
||||
public EnumBindingSourceExtension(Type enumType)
|
||||
{
|
||||
EnumType = enumType;
|
||||
}
|
||||
|
||||
public Type? EnumType
|
||||
{
|
||||
get => _enumType;
|
||||
@@ -15,7 +24,7 @@ class EnumBindingSourceExtension : MarkupExtension
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
Type enumType = Nullable.GetUnderlyingType(value) ?? value;
|
||||
var enumType = Nullable.GetUnderlyingType(value) ?? value;
|
||||
if (!enumType.IsEnum)
|
||||
throw new ArgumentException("Type must be for an Enum.");
|
||||
}
|
||||
@@ -25,13 +34,6 @@ class EnumBindingSourceExtension : MarkupExtension
|
||||
}
|
||||
}
|
||||
|
||||
public EnumBindingSourceExtension() { }
|
||||
|
||||
public EnumBindingSourceExtension(Type enumType)
|
||||
{
|
||||
EnumType = enumType;
|
||||
}
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
if (_enumType == null)
|
||||
|
||||
Reference in New Issue
Block a user