mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-06-28 13:34:09 +08:00
解决不同系统语言下属性读取异常问题
This commit is contained in:
parent
9191f3d1ec
commit
db2403a72f
@ -30,7 +30,7 @@ namespace CPF.Controls
|
|||||||
public bool IsSelected
|
public bool IsSelected
|
||||||
{
|
{
|
||||||
get { return GetValue<bool>(); }
|
get { return GetValue<bool>(); }
|
||||||
internal set { SetValue(value); }
|
set { SetValue(value); }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置标记控件的项
|
/// 获取或设置标记控件的项
|
||||||
|
@ -346,7 +346,7 @@ namespace CPF
|
|||||||
List<PropertyMetadataAttribute> propertyList = new List<PropertyMetadataAttribute>();
|
List<PropertyMetadataAttribute> propertyList = new List<PropertyMetadataAttribute>();
|
||||||
var list = type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);
|
var list = type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);
|
||||||
|
|
||||||
list = list.OrderBy(a => a, new TypeCompar()).ThenBy(a => a.Name).ToArray();
|
list = list.OrderBy(a => a, new TypeCompar()).ThenBy(a => a.Name, StringComparer.Ordinal).ToArray();
|
||||||
|
|
||||||
OverrideMetadata om = new OverrideMetadata();
|
OverrideMetadata om = new OverrideMetadata();
|
||||||
OnOverrideMetadata(om);
|
OnOverrideMetadata(om);
|
||||||
|
@ -373,8 +373,8 @@ namespace CPF
|
|||||||
[Description("键盘焦点")]
|
[Description("键盘焦点")]
|
||||||
public bool IsKeyboardFocused
|
public bool IsKeyboardFocused
|
||||||
{
|
{
|
||||||
get { return (bool)GetValue(21); }
|
get { return (bool)GetValue(22); }
|
||||||
private set { SetValue(value, 21); }
|
private set { SetValue(value, 22); }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取一个值,该值指示键盘焦点是否位于元素或其可视化树子元素内的任意位置
|
/// 获取一个值,该值指示键盘焦点是否位于元素或其可视化树子元素内的任意位置
|
||||||
@ -383,8 +383,8 @@ namespace CPF
|
|||||||
[Description("获取一个值,该值指示键盘焦点是否位于元素或其可视化树子元素内的任意位置")]
|
[Description("获取一个值,该值指示键盘焦点是否位于元素或其可视化树子元素内的任意位置")]
|
||||||
public bool IsKeyboardFocusWithin
|
public bool IsKeyboardFocusWithin
|
||||||
{
|
{
|
||||||
get { return (bool)GetValue(22); }
|
get { return (bool)GetValue(21); }
|
||||||
private set { SetValue(value, 22); }
|
private set { SetValue(value, 21); }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取焦点的导航方式
|
/// 获取焦点的导航方式
|
||||||
@ -393,8 +393,8 @@ namespace CPF
|
|||||||
[PropertyMetadata(null)]
|
[PropertyMetadata(null)]
|
||||||
public NavigationMethod? FocusMethod
|
public NavigationMethod? FocusMethod
|
||||||
{
|
{
|
||||||
get { return (NavigationMethod?)GetValue(14); }
|
get { return (NavigationMethod?)GetValue(13); }
|
||||||
private set { SetValue(value, 14); }
|
private set { SetValue(value, 13); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -404,8 +404,8 @@ namespace CPF
|
|||||||
[PropertyMetadata(false)]
|
[PropertyMetadata(false)]
|
||||||
public bool Focusable
|
public bool Focusable
|
||||||
{
|
{
|
||||||
get { return GetValue<bool>(10); }
|
get { return GetValue<bool>(14); }
|
||||||
set { SetValue(value, 10); }
|
set { SetValue(value, 14); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -444,8 +444,8 @@ namespace CPF
|
|||||||
[PropertyMetadata(typeof(ViewFill), "#000")]
|
[PropertyMetadata(typeof(ViewFill), "#000")]
|
||||||
public ViewFill FocusFrameFill
|
public ViewFill FocusFrameFill
|
||||||
{
|
{
|
||||||
get { return GetValue<ViewFill>(11); }
|
get { return GetValue<ViewFill>(10); }
|
||||||
set { SetValue(value, 11); }
|
set { SetValue(value, 10); }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 按tab键切换焦点显示的聚焦框
|
/// 按tab键切换焦点显示的聚焦框
|
||||||
@ -454,8 +454,8 @@ namespace CPF
|
|||||||
[PropertyMetadata(typeof(Stroke), "1,Dash")]
|
[PropertyMetadata(typeof(Stroke), "1,Dash")]
|
||||||
public Stroke FocusFrameStroke
|
public Stroke FocusFrameStroke
|
||||||
{
|
{
|
||||||
get { return GetValue<Stroke>(13); }
|
get { return GetValue<Stroke>(12); }
|
||||||
set { SetValue(value, 13); }
|
set { SetValue(value, 12); }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 聚焦框到元素边缘距离
|
/// 聚焦框到元素边缘距离
|
||||||
@ -463,8 +463,8 @@ namespace CPF
|
|||||||
[UIPropertyMetadata(typeof(Thickness), "3", UIPropertyOptions.AffectsRender), Description("聚焦框到元素边缘距离")]
|
[UIPropertyMetadata(typeof(Thickness), "3", UIPropertyOptions.AffectsRender), Description("聚焦框到元素边缘距离")]
|
||||||
public Thickness FocusFramePadding
|
public Thickness FocusFramePadding
|
||||||
{
|
{
|
||||||
get { return GetValue<Thickness>(12); }
|
get { return GetValue<Thickness>(11); }
|
||||||
set { SetValue(value, 12); }
|
set { SetValue(value, 11); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -1053,6 +1053,10 @@ namespace CPF
|
|||||||
toolTipElement.Dispose();
|
toolTipElement.Dispose();
|
||||||
toolTipElement = null;
|
toolTipElement = null;
|
||||||
}
|
}
|
||||||
|
if (newValue is string str && string.IsNullOrEmpty(str))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (newValue != null)
|
if (newValue != null)
|
||||||
{
|
{
|
||||||
UIElement element = newValue as UIElement;
|
UIElement element = newValue as UIElement;
|
||||||
|
Loading…
Reference in New Issue
Block a user