规范类名及命名空间名称
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls.Primitives;
|
||||
|
||||
namespace XP.ImageProcessing.RoiControl
|
||||
{
|
||||
/// <summary>
|
||||
/// ROI控制�?
|
||||
/// </summary>
|
||||
public class ControlThumb : Thumb
|
||||
{
|
||||
private static readonly Style? thumbStyle;
|
||||
|
||||
static ControlThumb()
|
||||
{
|
||||
try
|
||||
{
|
||||
ResourceDictionary dictionary = new ResourceDictionary();
|
||||
dictionary.Source = new Uri("pack://application:,,,/XP.ImageProcessing.RoiControl;component/Themes/Generic.xaml", UriKind.Absolute);
|
||||
thumbStyle = (Style?)dictionary["AreaControlThumbStyle"];
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 如果样式加载失败,使用默认样�?
|
||||
thumbStyle = null;
|
||||
}
|
||||
}
|
||||
|
||||
public ControlThumb()
|
||||
{
|
||||
if (thumbStyle != null)
|
||||
{
|
||||
Style = thumbStyle;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 默认样式
|
||||
Width = 12;
|
||||
Height = 12;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user