Merge branch 'master' into patch-5
This commit is contained in:
173 files changed
+2208
-1798
No files matched your search
@@ -9,7 +9,7 @@ namespace HandyControl.Collections
|
||||
[Serializable]
|
||||
public class ManualObservableCollection<T> : Collection<T>, INotifyCollectionChanged, INotifyPropertyChanged
|
||||
{
|
||||
private readonly SimpleMonitor _monitor = new SimpleMonitor();
|
||||
private readonly SimpleMonitor _monitor = new();
|
||||
|
||||
private const string CountString = "Count";
|
||||
|
||||
|
||||
@@ -258,50 +258,45 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnShowRowNumberChanged(DependencyObject target, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (!(target is DataGrid dataGrid)) return;
|
||||
if (target is not DataGrid dataGrid) return;
|
||||
var show = (bool) e.NewValue;
|
||||
|
||||
if (show)
|
||||
{
|
||||
dataGrid.LoadingRow += DataGrid_LoadingRow;
|
||||
dataGrid.ItemContainerGenerator.ItemsChanged += ItemContainerGenerator_ItemsChanged;
|
||||
dataGrid.ItemContainerGenerator.ItemsChanged += ItemContainerGeneratorItemsChanged;
|
||||
}
|
||||
else
|
||||
{
|
||||
dataGrid.LoadingRow -= DataGrid_LoadingRow;
|
||||
dataGrid.ItemContainerGenerator.ItemsChanged -= ItemContainerGenerator_ItemsChanged;
|
||||
dataGrid.ItemContainerGenerator.ItemsChanged -= ItemContainerGeneratorItemsChanged;
|
||||
}
|
||||
|
||||
UpdateItems(dataGrid.ItemContainerGenerator, dataGrid.Items.Count, show);
|
||||
}
|
||||
|
||||
private static void ItemContainerGenerator_ItemsChanged(object sender, ItemsChangedEventArgs e)
|
||||
{
|
||||
if (!(sender is ItemContainerGenerator generator)) return;
|
||||
UpdateItems(generator, e.ItemCount);
|
||||
}
|
||||
|
||||
private static void UpdateItems(ItemContainerGenerator generator, int itemsCount, bool show = true)
|
||||
{
|
||||
if (show)
|
||||
void ItemContainerGeneratorItemsChanged(object sender, ItemsChangedEventArgs e)
|
||||
{
|
||||
for (var i = 0; i < itemsCount; i++)
|
||||
var generator = dataGrid.ItemContainerGenerator;
|
||||
var itemsCount = dataGrid.Items.Count;
|
||||
|
||||
if (show)
|
||||
{
|
||||
var row = (DataGridRow) generator.ContainerFromIndex(i);
|
||||
if (row != null)
|
||||
for (var i = 0; i < itemsCount; i++)
|
||||
{
|
||||
row.Header = (i + 1).ToString();
|
||||
var row = (DataGridRow) generator.ContainerFromIndex(i);
|
||||
if (row != null)
|
||||
{
|
||||
row.Header = (i + 1).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i = 0; i < itemsCount; i++)
|
||||
else
|
||||
{
|
||||
var row = (DataGridRow) generator.ContainerFromIndex(i);
|
||||
if (row != null)
|
||||
for (var i = 0; i < itemsCount; i++)
|
||||
{
|
||||
row.Header = null;
|
||||
var row = (DataGridRow) generator.ContainerFromIndex(i);
|
||||
if (row != null)
|
||||
{
|
||||
row.Header = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -337,7 +332,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
public static void SetCanUnselectAllWithBlankArea(DependencyObject element, bool value)
|
||||
=> element.SetValue(CanUnselectAllWithBlankAreaProperty, value);
|
||||
=> element.SetValue(CanUnselectAllWithBlankAreaProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
public static bool GetCanUnselectAllWithBlankArea(DependencyObject element)
|
||||
=> (bool) element.GetValue(CanUnselectAllWithBlankAreaProperty);
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace HandyControl.Controls
|
||||
new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits));
|
||||
|
||||
public static void SetAutoWidth(DependencyObject element, bool value)
|
||||
=> element.SetValue(AutoWidthProperty, value);
|
||||
=> element.SetValue(AutoWidthProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
public static bool GetAutoWidth(DependencyObject element)
|
||||
=> (bool) element.GetValue(AutoWidthProperty);
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class GridAttach
|
||||
{
|
||||
public static readonly DependencyProperty NameProperty = DependencyProperty.RegisterAttached(
|
||||
"Name", typeof(string), typeof(GridAttach), new PropertyMetadata(default(string)));
|
||||
|
||||
public static void SetName(DependencyObject element, string value)
|
||||
=> element.SetValue(NameProperty, value);
|
||||
|
||||
public static string GetName(DependencyObject element)
|
||||
=> (string) element.GetValue(NameProperty);
|
||||
|
||||
public static readonly DependencyProperty RowNameProperty = DependencyProperty.RegisterAttached(
|
||||
"RowName", typeof(string), typeof(GridAttach), new PropertyMetadata(default(string), OnRowNameChanged));
|
||||
|
||||
private static void OnRowNameChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is FrameworkElement frameworkElement)
|
||||
{
|
||||
if (e.NewValue is string rowName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(rowName))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (frameworkElement.Parent is Grid grid)
|
||||
{
|
||||
for (var i = 0; i < grid.RowDefinitions.Count; i++)
|
||||
{
|
||||
var gridRowDefinition = grid.RowDefinitions[i];
|
||||
var gridRowName = GetName(gridRowDefinition);
|
||||
|
||||
if (!string.IsNullOrEmpty(gridRowName) &&
|
||||
gridRowName.Equals(rowName, StringComparison.Ordinal))
|
||||
{
|
||||
Grid.SetRow(frameworkElement, i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetRowName(DependencyObject element, string value)
|
||||
=> element.SetValue(RowNameProperty, value);
|
||||
|
||||
public static string GetRowName(DependencyObject element)
|
||||
=> (string) element.GetValue(RowNameProperty);
|
||||
|
||||
public static readonly DependencyProperty ColumnNameProperty = DependencyProperty.RegisterAttached(
|
||||
"ColumnName", typeof(string), typeof(GridAttach), new PropertyMetadata(default(string), OnColumnNameChanged));
|
||||
|
||||
private static void OnColumnNameChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is FrameworkElement frameworkElement)
|
||||
{
|
||||
if (e.NewValue is string columnName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(columnName))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (frameworkElement.Parent is Grid grid)
|
||||
{
|
||||
for (var i = 0; i < grid.ColumnDefinitions.Count; i++)
|
||||
{
|
||||
var gridColumnDefinition = grid.ColumnDefinitions[i];
|
||||
var gridColumnName = GetName(gridColumnDefinition);
|
||||
|
||||
if (!string.IsNullOrEmpty(gridColumnName) &&
|
||||
gridColumnName.Equals(columnName, StringComparison.Ordinal))
|
||||
{
|
||||
Grid.SetColumn(frameworkElement, i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetColumnName(DependencyObject element, string value)
|
||||
=> element.SetValue(ColumnNameProperty, value);
|
||||
|
||||
public static string GetColumnName(DependencyObject element)
|
||||
=> (string) element.GetValue(ColumnNameProperty);
|
||||
}
|
||||
}
|
||||
@@ -16,13 +16,10 @@ namespace HandyControl.Controls
|
||||
{
|
||||
var topLine = (FrameworkElement) d;
|
||||
|
||||
if (e.NewValue is Popup popup)
|
||||
if (e.NewValue is Popup { TemplatedParent: MenuItem menuItem })
|
||||
{
|
||||
if (popup.TemplatedParent is MenuItem menuItem)
|
||||
{
|
||||
SetTopLine(menuItem, topLine);
|
||||
menuItem.Loaded += MenuItem_Loaded;
|
||||
}
|
||||
SetTopLine(menuItem, topLine);
|
||||
menuItem.Loaded += MenuItem_Loaded;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Windows;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class ScrollViewerAttach
|
||||
{
|
||||
public static readonly DependencyProperty AutoHideProperty = DependencyProperty.RegisterAttached(
|
||||
"AutoHide", typeof(bool), typeof(ScrollViewerAttach), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, FrameworkPropertyMetadataOptions.Inherits));
|
||||
|
||||
public static void SetAutoHide(DependencyObject element, bool value)
|
||||
=> element.SetValue(AutoHideProperty, value);
|
||||
|
||||
public static bool GetAutoHide(DependencyObject element)
|
||||
=> (bool) element.GetValue(AutoHideProperty);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
using System.Windows;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools.Helper;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
@@ -15,13 +18,11 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
ctl.TextTrimming = TextTrimming.WordEllipsis;
|
||||
UpdateTooltip(ctl);
|
||||
ctl.SizeChanged += TextBlock_SizeChanged;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctl.ClearValue(TextBlock.TextTrimmingProperty);
|
||||
ctl.SizeChanged -= TextBlock_SizeChanged;
|
||||
}
|
||||
}
|
||||
@@ -46,8 +47,25 @@ namespace HandyControl.Controls
|
||||
textBlock.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
|
||||
var width = textBlock.DesiredSize.Width - textBlock.Margin.Left - textBlock.Margin.Right;
|
||||
|
||||
ToolTipService.SetToolTip(textBlock,
|
||||
textBlock.RenderSize.Width > width || textBlock.ActualWidth < width ? textBlock.Text : null);
|
||||
// the code Math.Abs(CalcTextWidth(textBlock) - width) > 1 is not elegant end even bugly,
|
||||
// while it does solve the problem of Tooltip failure in some cases
|
||||
if (textBlock.RenderSize.Width > width || textBlock.ActualWidth < width || Math.Abs(CalcTextWidth(textBlock) - width) > 1)
|
||||
{
|
||||
ToolTipService.SetToolTip(textBlock, textBlock.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
ToolTipService.SetToolTip(textBlock, null);
|
||||
}
|
||||
}
|
||||
|
||||
private static double CalcTextWidth(TextBlock textBlock)
|
||||
{
|
||||
var formattedText = TextHelper.CreateFormattedText(textBlock.Text, textBlock.FlowDirection,
|
||||
new Typeface(textBlock.FontFamily, textBlock.FontStyle, textBlock.FontWeight, textBlock.FontStretch),
|
||||
textBlock.FontSize);
|
||||
|
||||
return formattedText.WidthIncludingTrailingWhitespace;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,7 +141,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
public static void SetHideWhenClosing(DependencyObject element, bool value)
|
||||
=> element.SetValue(HideWhenClosingProperty, value);
|
||||
=> element.SetValue(HideWhenClosingProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
public static bool GetHideWhenClosing(DependencyObject element)
|
||||
=> (bool) element.GetValue(HideWhenClosingProperty);
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnInstanceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (!(d is FrameworkElement target)) return;
|
||||
if (d is not FrameworkElement target) return;
|
||||
var element = (AdornerElement) e.NewValue;
|
||||
element.OnInstanceChanged(target);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnDataChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (!(d is UIElement target)) return;
|
||||
if (d is not UIElement target) return;
|
||||
|
||||
target.PreviewMouseLeftButtonDown -= Target_PreviewMouseLeftButtonDown;
|
||||
target.PreviewMouseLeftButtonUp -= Target_PreviewMouseLeftButtonUp;
|
||||
|
||||
@@ -60,6 +60,6 @@ namespace HandyControl.Controls
|
||||
return mySize;
|
||||
}
|
||||
|
||||
private static Size ConvertThickness2Size(Thickness th) => new Size(th.Left + th.Right, th.Top + th.Bottom);
|
||||
private static Size ConvertThickness2Size(Thickness th) => new(th.Left + th.Right, th.Top + th.Bottom);
|
||||
}
|
||||
}
|
||||
@@ -44,9 +44,9 @@ namespace HandyControl.Controls
|
||||
|
||||
private DispatcherTimer _updateTimer;
|
||||
|
||||
private readonly List<double> _widthList = new List<double>();
|
||||
private readonly List<double> _widthList = new();
|
||||
|
||||
private readonly Dictionary<object, CarouselItem> _entryDic = new Dictionary<object, CarouselItem>();
|
||||
private readonly Dictionary<object, CarouselItem> _entryDic = new();
|
||||
|
||||
private bool _isRefresh;
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace HandyControl.Controls
|
||||
/// <summary>
|
||||
/// 预设的颜色(一共18个,两行)
|
||||
/// </summary>
|
||||
private readonly List<string> _colorPresetList = new List<string>
|
||||
private readonly List<string> _colorPresetList = new()
|
||||
{
|
||||
"#f44336",
|
||||
"#e91e63",
|
||||
@@ -127,7 +127,7 @@ namespace HandyControl.Controls
|
||||
/// <summary>
|
||||
/// 颜色范围集合
|
||||
/// </summary>
|
||||
private readonly List<ColorRange> _colorRangeList = new List<ColorRange>
|
||||
private readonly List<ColorRange> _colorRangeList = new()
|
||||
{
|
||||
new ColorRange
|
||||
{
|
||||
@@ -164,7 +164,7 @@ namespace HandyControl.Controls
|
||||
/// <summary>
|
||||
/// 颜色分隔集合
|
||||
/// </summary>
|
||||
private readonly List<Color> _colorSeparateList = new List<Color>
|
||||
private readonly List<Color> _colorSeparateList = new()
|
||||
{
|
||||
Color.FromRgb(255, 0, 0),
|
||||
Color.FromRgb(255, 0, 255),
|
||||
@@ -469,7 +469,7 @@ namespace HandyControl.Controls
|
||||
var button = new Button
|
||||
{
|
||||
Margin = new Thickness(6),
|
||||
Style = ResourceHelper.GetResource<Style>(ResourceToken.ButtonCustom),
|
||||
Style = ResourceHelper.GetResourceInternal<Style>(ResourceToken.ButtonCustom),
|
||||
Content = new Border
|
||||
{
|
||||
Background = brush,
|
||||
@@ -549,7 +549,7 @@ namespace HandyControl.Controls
|
||||
var cIndex = _colorSeparateList.IndexOf(Color.FromRgb(list[0], list[1], list[2]));
|
||||
int sub;
|
||||
var direc = 0;
|
||||
if (cIndex < 5 && cIndex > 0)
|
||||
if (cIndex is < 5 and > 0)
|
||||
{
|
||||
var nextColorList = _colorSeparateList[cIndex + 1].ToList();
|
||||
var prevColorList = _colorSeparateList[cIndex - 1].ToList();
|
||||
@@ -680,29 +680,18 @@ namespace HandyControl.Controls
|
||||
private void NumericUpDownRgb_OnValueChanged(object sender, FunctionEventArgs<double> e)
|
||||
{
|
||||
if (!_appliedTemplate || !IsNeedUpdateInfo) return;
|
||||
if (e.OriginalSource is NumericUpDown ctl && ctl.Tag is string tag)
|
||||
if (e.OriginalSource is NumericUpDown { Tag: string tag })
|
||||
{
|
||||
var color = SelectedBrush.Color;
|
||||
IsNeedUpdateInfo = false;
|
||||
|
||||
switch (tag)
|
||||
SelectedBrush = tag switch
|
||||
{
|
||||
case "R":
|
||||
{
|
||||
SelectedBrush = new SolidColorBrush(Color.FromArgb(color.A, (byte) e.Info, color.G, color.B));
|
||||
break;
|
||||
}
|
||||
case "G":
|
||||
{
|
||||
SelectedBrush = new SolidColorBrush(Color.FromArgb(color.A, color.R, (byte) e.Info, color.B));
|
||||
break;
|
||||
}
|
||||
case "B":
|
||||
{
|
||||
SelectedBrush = new SolidColorBrush(Color.FromArgb(color.A, color.R, color.G, (byte) e.Info));
|
||||
break;
|
||||
}
|
||||
}
|
||||
"R" => new SolidColorBrush(Color.FromArgb(color.A, (byte) e.Info, color.G, color.B)),
|
||||
"G" => new SolidColorBrush(Color.FromArgb(color.A, color.R, (byte) e.Info, color.B)),
|
||||
"B" => new SolidColorBrush(Color.FromArgb(color.A, color.R, color.G, (byte) e.Info)),
|
||||
_ => SelectedBrush
|
||||
};
|
||||
|
||||
IsNeedUpdateInfo = true;
|
||||
}
|
||||
@@ -722,10 +711,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private void ToggleButtonDropper_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_colorDropper == null)
|
||||
{
|
||||
_colorDropper = new ColorDropper(this);
|
||||
}
|
||||
_colorDropper ??= new ColorDropper(this);
|
||||
// ReSharper disable once PossibleInvalidOperationException
|
||||
_colorDropper.Update(_toggleButtonDropper.IsChecked.Value);
|
||||
}
|
||||
@@ -748,6 +734,6 @@ namespace HandyControl.Controls
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
public bool CanDispose { get; } = true;
|
||||
public bool CanDispose => true;
|
||||
}
|
||||
}
|
||||
@@ -69,12 +69,12 @@ namespace HandyControl.Controls
|
||||
/// <summary>
|
||||
/// 存储所有的内容
|
||||
/// </summary>
|
||||
private readonly Dictionary<int, object> _contentDic = new Dictionary<int, object>();
|
||||
private readonly Dictionary<int, object> _contentDic = new();
|
||||
|
||||
/// <summary>
|
||||
/// 当前在显示范围内的项
|
||||
/// </summary>
|
||||
private readonly Dictionary<int, CoverFlowItem> _itemShowDic = new Dictionary<int, CoverFlowItem>();
|
||||
private readonly Dictionary<int, CoverFlowItem> _itemShowDic = new();
|
||||
|
||||
/// <summary>
|
||||
/// 相机
|
||||
|
||||
@@ -72,12 +72,12 @@ namespace HandyControl.Controls
|
||||
|
||||
var textureCoordinates = new PointCollection
|
||||
{
|
||||
new Point(0, 1),
|
||||
new Point(1, 1),
|
||||
new Point(1, 0),
|
||||
new Point(0, 0),
|
||||
new Point(1, 0),
|
||||
new Point(1, 1)
|
||||
new(0, 1),
|
||||
new(1, 1),
|
||||
new(1, 0),
|
||||
new(0, 0),
|
||||
new(1, 0),
|
||||
new(1, 1)
|
||||
};
|
||||
|
||||
var normals = new Vector3DCollection
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private IEnumerable _itemsSourceInternal;
|
||||
|
||||
private readonly Dictionary<object, CoverViewItem> _entryDic = new Dictionary<object, CoverViewItem>();
|
||||
private readonly Dictionary<object, CoverViewItem> _entryDic = new();
|
||||
|
||||
private bool _isRefresh;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private AdornerContainer _container;
|
||||
|
||||
private static readonly Dictionary<string, FrameworkElement> ContainerDic = new Dictionary<string, FrameworkElement>();
|
||||
private static readonly Dictionary<string, FrameworkElement> ContainerDic = new();
|
||||
|
||||
public static readonly DependencyProperty IsClosedProperty = DependencyProperty.Register(
|
||||
"IsClosed", typeof(bool), typeof(Dialog), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
@@ -25,7 +26,9 @@ namespace HandyControl.Controls
|
||||
#region Constants
|
||||
|
||||
private const string ElementPanelMore = "PART_PanelMore";
|
||||
|
||||
private const string ElementGridMain = "PART_GridMain";
|
||||
|
||||
private const string ElementButtonClose = "PART_ButtonClose";
|
||||
|
||||
#endregion Constants
|
||||
@@ -56,7 +59,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
private DispatcherTimer _timerClose;
|
||||
|
||||
private static readonly Dictionary<string, Panel> PanelDic = new Dictionary<string, Panel>();
|
||||
private static readonly Dictionary<string, Panel> PanelDic = new();
|
||||
|
||||
#endregion Data
|
||||
|
||||
@@ -176,15 +179,6 @@ namespace HandyControl.Controls
|
||||
public static readonly DependencyProperty TypeProperty = DependencyProperty.Register(
|
||||
"Type", typeof(InfoType), typeof(Growl), new PropertyMetadata(default(InfoType)));
|
||||
|
||||
public static readonly DependencyProperty GrowlParentProperty = DependencyProperty.RegisterAttached(
|
||||
"GrowlParent", typeof(bool), typeof(Growl), new PropertyMetadata(ValueBoxes.FalseBox, (o, args) =>
|
||||
{
|
||||
if ((bool) args.NewValue && o is Panel panel)
|
||||
{
|
||||
SetGrowlPanel(panel);
|
||||
}
|
||||
}));
|
||||
|
||||
public static readonly DependencyProperty TokenProperty = DependencyProperty.RegisterAttached(
|
||||
"Token", typeof(string), typeof(Growl), new PropertyMetadata(default(string), OnTokenChanged));
|
||||
|
||||
@@ -209,10 +203,28 @@ namespace HandyControl.Controls
|
||||
public static string GetToken(DependencyObject element)
|
||||
=> (string) element.GetValue(TokenProperty);
|
||||
|
||||
public static readonly DependencyProperty GrowlParentProperty = DependencyProperty.RegisterAttached(
|
||||
"GrowlParent", typeof(bool), typeof(Growl), new PropertyMetadata(ValueBoxes.FalseBox, (o, args) =>
|
||||
{
|
||||
if ((bool) args.NewValue && o is Panel panel)
|
||||
{
|
||||
SetGrowlPanel(panel);
|
||||
}
|
||||
}));
|
||||
|
||||
public static void SetGrowlParent(DependencyObject element, bool value) => element.SetValue(GrowlParentProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
public static bool GetGrowlParent(DependencyObject element) => (bool) element.GetValue(GrowlParentProperty);
|
||||
|
||||
private static readonly DependencyProperty IsCreatedAutomaticallyProperty = DependencyProperty.RegisterAttached(
|
||||
"IsCreatedAutomatically", typeof(bool), typeof(Growl), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
private static void SetIsCreatedAutomatically(DependencyObject element, bool value)
|
||||
=> element.SetValue(IsCreatedAutomaticallyProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
private static bool GetIsCreatedAutomatically(DependencyObject element)
|
||||
=> (bool) element.GetValue(IsCreatedAutomaticallyProperty);
|
||||
|
||||
public InfoType Type
|
||||
{
|
||||
get => (InfoType) GetValue(TypeProperty);
|
||||
@@ -316,7 +328,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
};
|
||||
|
||||
PanelElement.SetFluidMoveBehavior(panel, ResourceHelper.GetResource<FluidMoveBehavior>(ResourceToken.BehaviorXY400));
|
||||
PanelElement.SetFluidMoveBehavior(panel, ResourceHelper.GetResourceInternal<FluidMoveBehavior>(ResourceToken.BehaviorXY400));
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@@ -331,7 +343,7 @@ namespace HandyControl.Controls
|
||||
|
||||
var transform = new TranslateTransform
|
||||
{
|
||||
X = MaxWidth
|
||||
X = FlowDirection == FlowDirection.LeftToRight ? MaxWidth : -MaxWidth
|
||||
};
|
||||
_gridMain.RenderTransform = transform;
|
||||
transform.BeginAnimation(TranslateTransform.XProperty, AnimationHelper.CreateAnimation(0));
|
||||
@@ -340,28 +352,28 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void ShowGlobal(GrowlInfo growlInfo)
|
||||
{
|
||||
if (GrowlWindow == null)
|
||||
{
|
||||
GrowlWindow = new GrowlWindow();
|
||||
GrowlWindow.Show();
|
||||
InitGrowlPanel(GrowlWindow.GrowlPanel);
|
||||
GrowlWindow.Init();
|
||||
}
|
||||
|
||||
GrowlWindow.Show(true);
|
||||
|
||||
Application.Current.Dispatcher?.Invoke(
|
||||
#if NET40
|
||||
new Action(
|
||||
#endif
|
||||
() =>
|
||||
{
|
||||
if (GrowlWindow == null)
|
||||
{
|
||||
GrowlWindow = new GrowlWindow();
|
||||
GrowlWindow.Show();
|
||||
InitGrowlPanel(GrowlWindow.GrowlPanel);
|
||||
GrowlWindow.Init();
|
||||
}
|
||||
|
||||
GrowlWindow.Show(true);
|
||||
|
||||
var ctl = new Growl
|
||||
{
|
||||
Message = growlInfo.Message,
|
||||
Time = DateTime.Now,
|
||||
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey),
|
||||
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey),
|
||||
Icon = ResourceHelper.GetResourceInternal<Geometry>(growlInfo.IconKey),
|
||||
IconBrush = ResourceHelper.GetResourceInternal<Brush>(growlInfo.IconBrushKey),
|
||||
_showCloseButton = growlInfo.ShowCloseButton,
|
||||
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
||||
_staysOpen = growlInfo.StaysOpen,
|
||||
@@ -369,7 +381,8 @@ namespace HandyControl.Controls
|
||||
ConfirmStr = growlInfo.ConfirmStr,
|
||||
CancelStr = growlInfo.CancelStr,
|
||||
Type = growlInfo.Type,
|
||||
_waitTime = Math.Max(growlInfo.WaitTime, 2)
|
||||
_waitTime = Math.Max(growlInfo.WaitTime, 2),
|
||||
FlowDirection = growlInfo.FlowDirection
|
||||
};
|
||||
GrowlWindow.GrowlPanel.Children.Insert(0, ctl);
|
||||
}
|
||||
@@ -395,8 +408,8 @@ namespace HandyControl.Controls
|
||||
{
|
||||
Message = growlInfo.Message,
|
||||
Time = DateTime.Now,
|
||||
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey),
|
||||
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey),
|
||||
Icon = ResourceHelper.GetResourceInternal<Geometry>(growlInfo.IconKey),
|
||||
IconBrush = ResourceHelper.GetResourceInternal<Brush>(growlInfo.IconBrushKey),
|
||||
_showCloseButton = growlInfo.ShowCloseButton,
|
||||
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
||||
_staysOpen = growlInfo.StaysOpen,
|
||||
@@ -406,6 +419,7 @@ namespace HandyControl.Controls
|
||||
Type = growlInfo.Type,
|
||||
_waitTime = Math.Max(growlInfo.WaitTime, 2)
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(growlInfo.Token))
|
||||
{
|
||||
if (PanelDic.TryGetValue(growlInfo.Token, out var panel))
|
||||
@@ -415,6 +429,8 @@ namespace HandyControl.Controls
|
||||
}
|
||||
else
|
||||
{
|
||||
// GrowlPanel is null, we create it automatically
|
||||
GrowlPanel ??= CreateDefaultPanel();
|
||||
GrowlPanel?.Children.Insert(0, ctl);
|
||||
}
|
||||
}
|
||||
@@ -424,6 +440,64 @@ namespace HandyControl.Controls
|
||||
);
|
||||
}
|
||||
|
||||
private static Panel CreateDefaultPanel()
|
||||
{
|
||||
FrameworkElement element = WindowHelper.GetActiveWindow();
|
||||
var decorator = VisualHelper.GetChild<AdornerDecorator>(element);
|
||||
|
||||
if (decorator != null)
|
||||
{
|
||||
var layer = decorator.AdornerLayer;
|
||||
if (layer != null)
|
||||
{
|
||||
var panel = new StackPanel
|
||||
{
|
||||
VerticalAlignment = VerticalAlignment.Top
|
||||
};
|
||||
|
||||
InitGrowlPanel(panel);
|
||||
SetIsCreatedAutomatically(panel, true);
|
||||
|
||||
var scrollViewer = new ScrollViewer
|
||||
{
|
||||
HorizontalAlignment = HorizontalAlignment.Right,
|
||||
VerticalScrollBarVisibility = ScrollBarVisibility.Hidden,
|
||||
IsInertiaEnabled = true,
|
||||
IsPenetrating = true,
|
||||
Content = panel
|
||||
};
|
||||
|
||||
var container = new AdornerContainer(layer)
|
||||
{
|
||||
Child = scrollViewer
|
||||
};
|
||||
|
||||
layer.Add(container);
|
||||
|
||||
return panel;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void RemoveDefaultPanel(Panel panel)
|
||||
{
|
||||
FrameworkElement element = WindowHelper.GetActiveWindow();
|
||||
var decorator = VisualHelper.GetChild<AdornerDecorator>(element);
|
||||
|
||||
if (decorator != null)
|
||||
{
|
||||
var layer = decorator.AdornerLayer;
|
||||
var adorner = VisualHelper.GetParent<Adorner>(panel);
|
||||
|
||||
if (adorner != null)
|
||||
{
|
||||
layer?.Remove(adorner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitGrowlInfo(ref GrowlInfo growlInfo, InfoType infoType)
|
||||
{
|
||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
||||
@@ -487,18 +561,6 @@ namespace HandyControl.Controls
|
||||
growlInfo.IconBrushKey = ResourceToken.PrimaryTextBrush;
|
||||
growlInfo.StaysOpen = true;
|
||||
growlInfo.ShowCloseButton = false;
|
||||
Application.Current.Dispatcher?.Invoke(
|
||||
#if NET40
|
||||
new Action(
|
||||
#endif
|
||||
() =>
|
||||
{
|
||||
if (GrowlPanel.ContextMenu != null) GrowlPanel.ContextMenu.Opacity = 0;
|
||||
}
|
||||
#if NET40
|
||||
)
|
||||
#endif
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -769,7 +831,7 @@ namespace HandyControl.Controls
|
||||
ShowGlobal(growlInfo);
|
||||
}
|
||||
|
||||
private void ButtonClose_OnClick(object sender, RoutedEventArgs e) => Close();
|
||||
private void ButtonClose_OnClick(object sender, RoutedEventArgs e) => Close(true, false);
|
||||
|
||||
/// <summary>
|
||||
/// 关闭
|
||||
@@ -784,17 +846,29 @@ namespace HandyControl.Controls
|
||||
_timerClose?.Stop();
|
||||
var transform = new TranslateTransform();
|
||||
_gridMain.RenderTransform = transform;
|
||||
var animation = AnimationHelper.CreateAnimation(ActualWidth);
|
||||
var animation = AnimationHelper.CreateAnimation(FlowDirection == FlowDirection.LeftToRight ? ActualWidth : -ActualWidth);
|
||||
animation.Completed += (s, e) =>
|
||||
{
|
||||
if (Parent is Panel panel)
|
||||
{
|
||||
panel.Children.Remove(this);
|
||||
|
||||
if (GrowlWindow?.GrowlPanel != null && GrowlWindow.GrowlPanel.Children.Count == 0)
|
||||
if (GrowlWindow != null)
|
||||
{
|
||||
GrowlWindow.Close();
|
||||
GrowlWindow = null;
|
||||
if (GrowlWindow.GrowlPanel != null && GrowlWindow.GrowlPanel.Children.Count == 0)
|
||||
{
|
||||
GrowlWindow.Close();
|
||||
GrowlWindow = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GrowlPanel != null && GrowlPanel.Children.Count == 0 && GetIsCreatedAutomatically(GrowlPanel))
|
||||
{
|
||||
// If the count of children is zero, we need to remove the panel, provided that the panel was created automatically
|
||||
RemoveDefaultPanel(GrowlPanel);
|
||||
GrowlPanel = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -824,16 +898,7 @@ namespace HandyControl.Controls
|
||||
/// 清除
|
||||
/// </summary>
|
||||
/// <param name="panel"></param>
|
||||
private static void Clear(Panel panel)
|
||||
{
|
||||
if (panel == null) return;
|
||||
panel.Children.Clear();
|
||||
if (panel.ContextMenu != null)
|
||||
{
|
||||
panel.ContextMenu.IsOpen = false;
|
||||
panel.ContextMenu.Opacity = 1;
|
||||
}
|
||||
}
|
||||
private static void Clear(Panel panel) => panel?.Children.Clear();
|
||||
|
||||
/// <summary>
|
||||
/// 清除
|
||||
|
||||
@@ -17,8 +17,7 @@ namespace HandyControl.Controls
|
||||
|
||||
GrowlPanel = new StackPanel
|
||||
{
|
||||
VerticalAlignment = VerticalAlignment.Top,
|
||||
Margin = new Thickness(0, 10, 10, 10)
|
||||
VerticalAlignment = VerticalAlignment.Top
|
||||
};
|
||||
|
||||
Content = new ScrollViewer
|
||||
|
||||
@@ -19,9 +19,9 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public class GifImage : Image, IDisposable
|
||||
{
|
||||
private static readonly Guid GifGuid = new Guid("{b96b3caa-0728-11d3-9d7b-0000f81ef32e}");
|
||||
private static readonly Guid GifGuid = new("{b96b3caa-0728-11d3-9d7b-0000f81ef32e}");
|
||||
|
||||
private static readonly Guid GifSingleFrameGuid = new Guid("{b96b3cb0-0728-11d3-9d7b-0000f81ef32e}");
|
||||
private static readonly Guid GifSingleFrameGuid = new("{b96b3cb0-0728-11d3-9d7b-0000f81ef32e}");
|
||||
|
||||
internal IntPtr NativeImage;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace HandyControl.Controls
|
||||
/// <summary>
|
||||
/// 图片保存对话框
|
||||
/// </summary>
|
||||
private static readonly SaveFileDialog SaveFileDialog = new SaveFileDialog
|
||||
private static readonly SaveFileDialog SaveFileDialog = new()
|
||||
{
|
||||
Filter = $"{Lang.PngImg}|*.png"
|
||||
};
|
||||
@@ -160,6 +160,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private DispatcherTimer _dispatcher;
|
||||
|
||||
private bool _isLoaded;
|
||||
|
||||
#endregion Data
|
||||
|
||||
#region ctor
|
||||
@@ -174,7 +176,11 @@ namespace HandyControl.Controls
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.RotateLeft, ButtonRotateLeft_OnClick));
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.RotateRight, ButtonRotateRight_OnClick));
|
||||
|
||||
Loaded += (s, e) => Init();
|
||||
Loaded += (s, e) =>
|
||||
{
|
||||
_isLoaded = true;
|
||||
Init();
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -445,7 +451,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
private void Init()
|
||||
{
|
||||
if (ImageSource == null || !IsLoaded) return;
|
||||
if (ImageSource == null || !_isLoaded) return;
|
||||
|
||||
if (ImageSource.IsDownloading)
|
||||
{
|
||||
@@ -464,13 +470,13 @@ namespace HandyControl.Controls
|
||||
|
||||
if (!_isOblique)
|
||||
{
|
||||
width = ImageSource.Width;
|
||||
height = ImageSource.Height;
|
||||
width = ImageSource.PixelWidth;
|
||||
height = ImageSource.PixelHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = ImageSource.Height;
|
||||
height = ImageSource.Width;
|
||||
width = ImageSource.PixelHeight;
|
||||
height = ImageSource.PixelWidth;
|
||||
}
|
||||
|
||||
ImageWidth = width;
|
||||
@@ -514,7 +520,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (_dispatcher == null) return;
|
||||
|
||||
if (ImageSource == null || !IsLoaded)
|
||||
if (ImageSource == null || !_isLoaded)
|
||||
{
|
||||
_dispatcher.Stop();
|
||||
_dispatcher.Tick -= Dispatcher_Tick;
|
||||
|
||||
@@ -116,7 +116,15 @@ namespace HandyControl.Controls
|
||||
public CheckComboBox()
|
||||
{
|
||||
AddHandler(Controls.Tag.ClosedEvent, new RoutedEventHandler(Tags_OnClosed));
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.Clear, (s, e) => SelectedItems.Clear()));
|
||||
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.Clear, (s, e) =>
|
||||
{
|
||||
SetCurrentValue(SelectedValueProperty, null);
|
||||
SetCurrentValue(SelectedItemProperty, null);
|
||||
SetCurrentValue(SelectedIndexProperty, -1);
|
||||
SelectedItems.Clear();
|
||||
}));
|
||||
|
||||
ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged;
|
||||
}
|
||||
|
||||
@@ -200,7 +208,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private void Tags_OnClosed(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is Tag tag && tag.Tag is CheckComboBoxItem checkComboBoxItem)
|
||||
if (e.OriginalSource is Tag { Tag: CheckComboBoxItem checkComboBoxItem })
|
||||
{
|
||||
checkComboBoxItem.SetCurrentValue(IsSelectedProperty, false);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,13 @@ namespace HandyControl.Controls
|
||||
public static readonly DependencyProperty IsDropDownOpenProperty = DependencyProperty.Register(
|
||||
"IsDropDownOpen", typeof(bool), typeof(DateTimePicker), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsDropDownOpenChanged, OnCoerceIsDropDownOpen));
|
||||
|
||||
private static object OnCoerceIsDropDownOpen(DependencyObject d, object baseValue) => d is DateTimePicker dp && !dp.IsEnabled ? false : baseValue;
|
||||
private static object OnCoerceIsDropDownOpen(DependencyObject d, object baseValue) =>
|
||||
d is DateTimePicker
|
||||
{
|
||||
IsEnabled: false
|
||||
}
|
||||
? false
|
||||
: baseValue;
|
||||
|
||||
private static void OnIsDropDownOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
@@ -172,7 +178,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnSelectedDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (!(d is DateTimePicker dp)) return;
|
||||
if (d is not DateTimePicker dp) return;
|
||||
|
||||
if (dp.SelectedDateTime.HasValue)
|
||||
{
|
||||
@@ -555,7 +561,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private void PopupPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (sender is Popup popup && !popup.StaysOpen)
|
||||
if (sender is Popup { StaysOpen: false })
|
||||
{
|
||||
if (_dropDownButton?.InputHitTest(e.GetPosition(_dropDownButton)) != null)
|
||||
{
|
||||
|
||||
@@ -302,21 +302,18 @@ namespace HandyControl.Controls
|
||||
ActualPasswordBox.SetBinding(System.Windows.Controls.PasswordBox.SelectionOpacityProperty, new Binding(SelectionOpacityProperty.Name) { Source = this });
|
||||
ActualPasswordBox.SetBinding(System.Windows.Controls.PasswordBox.CaretBrushProperty, new Binding(CaretBrushProperty.Name) { Source = this });
|
||||
|
||||
if (_password != null)
|
||||
if (_password is { Length: > 0 })
|
||||
{
|
||||
if (_password.Length > 0)
|
||||
var valuePtr = IntPtr.Zero;
|
||||
try
|
||||
{
|
||||
var valuePtr = IntPtr.Zero;
|
||||
try
|
||||
{
|
||||
valuePtr = Marshal.SecureStringToGlobalAllocUnicode(_password);
|
||||
ActualPasswordBox.Password = Marshal.PtrToStringUni(valuePtr) ?? throw new InvalidOperationException();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.ZeroFreeGlobalAllocUnicode(valuePtr);
|
||||
_password.Clear();
|
||||
}
|
||||
valuePtr = Marshal.SecureStringToGlobalAllocUnicode(_password);
|
||||
ActualPasswordBox.Password = Marshal.PtrToStringUni(valuePtr) ?? throw new InvalidOperationException();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.ZeroFreeGlobalAllocUnicode(valuePtr);
|
||||
_password.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,13 @@ namespace HandyControl.Controls
|
||||
typeof(TimePicker),
|
||||
new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsDropDownOpenChanged, OnCoerceIsDropDownOpen));
|
||||
|
||||
private static object OnCoerceIsDropDownOpen(DependencyObject d, object baseValue) => d is TimePicker dp && !dp.IsEnabled ? false : baseValue;
|
||||
private static object OnCoerceIsDropDownOpen(DependencyObject d, object baseValue) =>
|
||||
d is TimePicker
|
||||
{
|
||||
IsEnabled: false
|
||||
}
|
||||
? false
|
||||
: baseValue;
|
||||
|
||||
private static void OnIsDropDownOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
@@ -183,7 +189,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnSelectedTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (!(d is TimePicker dp)) return;
|
||||
if (d is not TimePicker dp) return;
|
||||
|
||||
if (dp.SelectedTime.HasValue)
|
||||
{
|
||||
@@ -340,16 +346,14 @@ namespace HandyControl.Controls
|
||||
private static void OnClockChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (TimePicker) d;
|
||||
var oldClock = e.OldValue as ClockBase;
|
||||
var newClock = e.NewValue as ClockBase;
|
||||
|
||||
if (oldClock != null)
|
||||
if (e.OldValue is ClockBase oldClock)
|
||||
{
|
||||
oldClock.SelectedTimeChanged -= ctl.Clock_SelectedTimeChanged;
|
||||
oldClock.Confirmed -= ctl.Clock_Confirmed;
|
||||
}
|
||||
|
||||
if (newClock != null)
|
||||
if (e.NewValue is ClockBase newClock)
|
||||
{
|
||||
newClock.ShowConfirmButton = true;
|
||||
newClock.SelectedTimeChanged += ctl.Clock_SelectedTimeChanged;
|
||||
@@ -589,7 +593,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private void PopupPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (sender is Popup popup && !popup.StaysOpen)
|
||||
if (sender is Popup { StaysOpen: false })
|
||||
{
|
||||
if (_dropDownButton?.InputHitTest(e.GetPosition(_dropDownButton)) != null)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace HandyControl.Controls
|
||||
"DotDelayTime", typeof(double), typeof(LoadingBase),
|
||||
new FrameworkPropertyMetadata(80.0, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
protected readonly Canvas PrivateCanvas = new Canvas
|
||||
protected readonly Canvas PrivateCanvas = new()
|
||||
{
|
||||
ClipToBounds = true
|
||||
};
|
||||
|
||||
@@ -12,19 +12,10 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public class AnimationPath : Shape
|
||||
{
|
||||
/// <summary>
|
||||
/// 故事板
|
||||
/// </summary>
|
||||
private Storyboard _storyboard;
|
||||
|
||||
/// <summary>
|
||||
/// 路径长度
|
||||
/// </summary>
|
||||
private double _pathLength;
|
||||
|
||||
/// <summary>
|
||||
/// 路径
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty DataProperty = DependencyProperty.Register(nameof(Data),
|
||||
typeof(Geometry), typeof(AnimationPath), new FrameworkPropertyMetadata(null,
|
||||
OnPropertiesChanged));
|
||||
@@ -37,9 +28,6 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 路径
|
||||
/// </summary>
|
||||
public Geometry Data
|
||||
{
|
||||
get => (Geometry) GetValue(DataProperty);
|
||||
@@ -48,31 +36,19 @@ namespace HandyControl.Controls
|
||||
|
||||
protected override Geometry DefiningGeometry => Data ?? Geometry.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 路径长度
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty PathLengthProperty = DependencyProperty.Register(
|
||||
"PathLength", typeof(double), typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, OnPropertiesChanged));
|
||||
|
||||
/// <summary>
|
||||
/// 路径长度
|
||||
/// </summary>
|
||||
public double PathLength
|
||||
{
|
||||
get => (double) GetValue(PathLengthProperty);
|
||||
set => SetValue(PathLengthProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 动画间隔时间
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty DurationProperty = DependencyProperty.Register(
|
||||
"Duration", typeof(Duration), typeof(AnimationPath), new FrameworkPropertyMetadata(new Duration(TimeSpan.FromSeconds(2)),
|
||||
OnPropertiesChanged));
|
||||
|
||||
/// <summary>
|
||||
/// 动画间隔时间
|
||||
/// </summary>
|
||||
public Duration Duration
|
||||
{
|
||||
get => (Duration) GetValue(DurationProperty);
|
||||
@@ -94,27 +70,31 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}));
|
||||
|
||||
/// <summary>
|
||||
/// 是否正在播放动画
|
||||
/// </summary>
|
||||
public bool IsPlaying
|
||||
{
|
||||
get => (bool) GetValue(IsPlayingProperty);
|
||||
set => SetValue(IsPlayingProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty RepeatBehaviorProperty = DependencyProperty.Register(
|
||||
"RepeatBehavior", typeof(RepeatBehavior), typeof(AnimationPath), new PropertyMetadata(RepeatBehavior.Forever));
|
||||
public static readonly DependencyProperty RepeatBehaviorProperty =
|
||||
Timeline.RepeatBehaviorProperty.AddOwner(typeof(AnimationPath),
|
||||
new PropertyMetadata(RepeatBehavior.Forever));
|
||||
|
||||
/// <summary>
|
||||
/// 动画重复行为
|
||||
/// </summary>
|
||||
public RepeatBehavior RepeatBehavior
|
||||
{
|
||||
get => (RepeatBehavior) GetValue(RepeatBehaviorProperty);
|
||||
set => SetValue(RepeatBehaviorProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty FillBehaviorProperty =
|
||||
Timeline.FillBehaviorProperty.AddOwner(typeof(AnimationPath), new PropertyMetadata(FillBehavior.Stop));
|
||||
|
||||
public FillBehavior FillBehavior
|
||||
{
|
||||
get { return (FillBehavior) GetValue(FillBehaviorProperty); }
|
||||
set { SetValue(FillBehaviorProperty, value); }
|
||||
}
|
||||
|
||||
static AnimationPath()
|
||||
{
|
||||
StretchProperty.AddOwner(typeof(AnimationPath), new FrameworkPropertyMetadata(Stretch.Uniform,
|
||||
@@ -126,25 +106,16 @@ namespace HandyControl.Controls
|
||||
|
||||
public AnimationPath() => Loaded += (s, e) => UpdatePath();
|
||||
|
||||
/// <summary>
|
||||
/// 动画完成事件
|
||||
/// </summary>
|
||||
public static readonly RoutedEvent CompletedEvent =
|
||||
EventManager.RegisterRoutedEvent("Completed", RoutingStrategy.Bubble,
|
||||
typeof(EventHandler), typeof(AnimationPath));
|
||||
|
||||
/// <summary>
|
||||
/// 动画完成事件
|
||||
/// </summary>
|
||||
public event EventHandler Completed
|
||||
{
|
||||
add => AddHandler(CompletedEvent, value);
|
||||
remove => RemoveHandler(CompletedEvent, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新路径
|
||||
/// </summary>
|
||||
private void UpdatePath()
|
||||
{
|
||||
if (!Duration.HasTimeSpan || !IsPlaying) return;
|
||||
@@ -160,7 +131,6 @@ namespace HandyControl.Controls
|
||||
_pathLength
|
||||
});
|
||||
|
||||
//定义动画
|
||||
if (_storyboard != null)
|
||||
{
|
||||
_storyboard.Stop();
|
||||
@@ -168,25 +138,26 @@ namespace HandyControl.Controls
|
||||
}
|
||||
_storyboard = new Storyboard
|
||||
{
|
||||
RepeatBehavior = RepeatBehavior
|
||||
RepeatBehavior = RepeatBehavior,
|
||||
FillBehavior = FillBehavior
|
||||
};
|
||||
_storyboard.Completed += Storyboard_Completed;
|
||||
|
||||
var frames = new DoubleAnimationUsingKeyFrames();
|
||||
//开始位置
|
||||
var frame0 = new LinearDoubleKeyFrame
|
||||
|
||||
var frameIn = new LinearDoubleKeyFrame
|
||||
{
|
||||
Value = _pathLength,
|
||||
KeyTime = KeyTime.FromTimeSpan(TimeSpan.Zero)
|
||||
};
|
||||
//结束位置
|
||||
var frame1 = new LinearDoubleKeyFrame
|
||||
frames.KeyFrames.Add(frameIn);
|
||||
|
||||
var frameOut = new LinearDoubleKeyFrame
|
||||
{
|
||||
Value = -_pathLength,
|
||||
Value = FillBehavior == FillBehavior.Stop ? -_pathLength : 0,
|
||||
KeyTime = KeyTime.FromTimeSpan(Duration.TimeSpan)
|
||||
};
|
||||
frames.KeyFrames.Add(frame0);
|
||||
frames.KeyFrames.Add(frame1);
|
||||
frames.KeyFrames.Add(frameOut);
|
||||
|
||||
Storyboard.SetTarget(frames, this);
|
||||
Storyboard.SetTargetProperty(frames, new PropertyPath(StrokeDashOffsetProperty));
|
||||
|
||||
@@ -63,7 +63,14 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register(
|
||||
"Maximum", typeof(int), typeof(Badge), new PropertyMetadata(ValueBoxes.Int99Box, OnValueChanged));
|
||||
"Maximum", typeof(int), typeof(Badge), new PropertyMetadata(ValueBoxes.Int99Box, OnMaximumChanged));
|
||||
|
||||
private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (Badge) d;
|
||||
var v = ctl.Value;
|
||||
ctl.SetCurrentValue(TextProperty, v <= ctl.Maximum ? v.ToString() : $"{ctl.Maximum}+");
|
||||
}
|
||||
|
||||
public int Maximum
|
||||
{
|
||||
|
||||
@@ -134,9 +134,9 @@ namespace HandyControl.Controls
|
||||
set => SetValue(BorderDashOffsetProperty, value);
|
||||
}
|
||||
|
||||
private static Size ConvertThickness2Size(Thickness th) => new Size(th.Left + th.Right, th.Top + th.Bottom);
|
||||
private static Size ConvertThickness2Size(Thickness th) => new(th.Left + th.Right, th.Top + th.Bottom);
|
||||
|
||||
private static Rect DeflateRect(Rect rt, Thickness thick) => new Rect(rt.Left + thick.Left,
|
||||
private static Rect DeflateRect(Rect rt, Thickness thick) => new(rt.Left + thick.Left,
|
||||
rt.Top + thick.Top,
|
||||
Math.Max(0.0, rt.Width - thick.Left - thick.Right),
|
||||
Math.Max(0.0, rt.Height - thick.Top - thick.Bottom));
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace HandyControl.Controls
|
||||
"ShowEmpty", typeof(bool), typeof(Empty), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits));
|
||||
|
||||
public static void SetShowEmpty(DependencyObject element, bool value)
|
||||
=> element.SetValue(ShowEmptyProperty, value);
|
||||
=> element.SetValue(ShowEmptyProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
public static bool GetShowEmpty(DependencyObject element)
|
||||
=> (bool) element.GetValue(ShowEmptyProperty);
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
Stretch = Stretch.UniformToFill
|
||||
}
|
||||
: ResourceHelper.GetResource<Brush>("SecondaryRegionBrush");
|
||||
: ResourceHelper.GetResourceInternal<Brush>("SecondaryRegionBrush");
|
||||
}
|
||||
|
||||
public ImageSource Source
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private const string ElementVisualBrush = "PART_VisualBrush";
|
||||
|
||||
private VisualBrush _visualBrush = new VisualBrush();
|
||||
private VisualBrush _visualBrush = new();
|
||||
|
||||
private readonly TranslateTransform _translateTransform;
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace HandyControl.Controls
|
||||
set => SetValue(VerticalOffsetProperty, value);
|
||||
}
|
||||
|
||||
public static Magnifier Default => new Magnifier();
|
||||
public static Magnifier Default => new();
|
||||
|
||||
public static readonly DependencyProperty ScaleProperty = DependencyProperty.Register(
|
||||
"Scale", typeof(double), typeof(Magnifier), new PropertyMetadata(5.0, OnScaleChanged), ValidateHelper.IsInRangeOfPosDouble);
|
||||
@@ -129,7 +129,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
layer.Remove(_adornerContainer);
|
||||
}
|
||||
else if (_adornerContainer != null && _adornerContainer.Parent is AdornerLayer parent)
|
||||
else if (_adornerContainer is { Parent: AdornerLayer parent })
|
||||
{
|
||||
parent.Remove(_adornerContainer);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private bool _added;
|
||||
|
||||
private readonly object _syncObj = new object();
|
||||
private readonly object _syncObj = new();
|
||||
|
||||
private readonly int _id;
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static int NextId;
|
||||
|
||||
private static readonly Dictionary<string, NotifyIcon> NotifyIconDic = new Dictionary<string, NotifyIcon>();
|
||||
private static readonly Dictionary<string, NotifyIcon> NotifyIconDic = new();
|
||||
|
||||
static NotifyIcon()
|
||||
{
|
||||
@@ -192,21 +192,14 @@ namespace HandyControl.Controls
|
||||
szInfo = content ?? string.Empty
|
||||
};
|
||||
|
||||
switch (infoType)
|
||||
data.dwInfoFlags = infoType switch
|
||||
{
|
||||
case NotifyIconInfoType.Info:
|
||||
data.dwInfoFlags = InteropValues.NIIF_INFO;
|
||||
break;
|
||||
case NotifyIconInfoType.Warning:
|
||||
data.dwInfoFlags = InteropValues.NIIF_WARNING;
|
||||
break;
|
||||
case NotifyIconInfoType.Error:
|
||||
data.dwInfoFlags = InteropValues.NIIF_ERROR;
|
||||
break;
|
||||
case NotifyIconInfoType.None:
|
||||
data.dwInfoFlags = InteropValues.NIIF_NONE;
|
||||
break;
|
||||
}
|
||||
NotifyIconInfoType.Info => InteropValues.NIIF_INFO,
|
||||
NotifyIconInfoType.Warning => InteropValues.NIIF_WARNING,
|
||||
NotifyIconInfoType.Error => InteropValues.NIIF_ERROR,
|
||||
NotifyIconInfoType.None => InteropValues.NIIF_NONE,
|
||||
_ => data.dwInfoFlags
|
||||
};
|
||||
|
||||
InteropMethods.Shell_NotifyIcon(InteropValues.NIM_MODIFY, data);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace HandyControl.Controls
|
||||
/// 最大页数
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty MaxPageCountProperty = DependencyProperty.Register(
|
||||
"MaxPageCount", typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, OnMaxPageCountChanged, CoerceMaxPageCount), ValidateHelper.IsInRangeOfPosInt);
|
||||
"MaxPageCount", typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, OnMaxPageCountChanged, CoerceMaxPageCount), ValidateHelper.IsInRangeOfPosIntIncludeZero);
|
||||
|
||||
private static object CoerceMaxPageCount(DependencyObject d, object basevalue)
|
||||
{
|
||||
@@ -157,11 +157,11 @@ namespace HandyControl.Controls
|
||||
/// 当前页
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty PageIndexProperty = DependencyProperty.Register(
|
||||
"PageIndex", typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, OnPageIndexChanged, CoercePageIndex), ValidateHelper.IsInRangeOfPosInt);
|
||||
"PageIndex", typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, OnPageIndexChanged, CoercePageIndex), ValidateHelper.IsInRangeOfPosIntIncludeZero);
|
||||
|
||||
private static object CoercePageIndex(DependencyObject d, object basevalue)
|
||||
{
|
||||
if (!(d is Pagination pagination)) return 1;
|
||||
if (d is not Pagination pagination) return 1;
|
||||
|
||||
var intValue = (int) basevalue;
|
||||
return intValue < 1
|
||||
@@ -383,16 +383,16 @@ namespace HandyControl.Controls
|
||||
|
||||
private RadioButton CreateButton(int page)
|
||||
{
|
||||
return new RadioButton
|
||||
return new()
|
||||
{
|
||||
Style = ResourceHelper.GetResource<Style>(ResourceToken.PaginationButtonStyle),
|
||||
Style = ResourceHelper.GetResourceInternal<Style>(ResourceToken.PaginationButtonStyle),
|
||||
Content = page.ToString()
|
||||
};
|
||||
}
|
||||
|
||||
private void ToggleButton_OnChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!(e.OriginalSource is RadioButton button)) return;
|
||||
if (e.OriginalSource is not RadioButton button) return;
|
||||
if (button.IsChecked == false) return;
|
||||
PageIndex = int.Parse(button.Content.ToString());
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace HandyControl.Controls
|
||||
set => SetValue(IsOpenProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
public static Poptip Default => new Poptip();
|
||||
public static Poptip Default => new();
|
||||
|
||||
protected sealed override void OnTargetChanged(FrameworkElement element, bool isNew)
|
||||
{
|
||||
@@ -287,7 +287,7 @@ namespace HandyControl.Controls
|
||||
private void Element_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
var hitMode = GetIsInstance(Target) ? HitMode : GetHitMode(Target);
|
||||
if (hitMode != HitMode.Hover || hitMode == HitMode.None) return;
|
||||
if (hitMode != HitMode.Hover) return;
|
||||
|
||||
SwitchPoptip(true);
|
||||
}
|
||||
@@ -295,7 +295,7 @@ namespace HandyControl.Controls
|
||||
private void Element_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
var hitMode = GetIsInstance(Target) ? HitMode : GetHitMode(Target);
|
||||
if (hitMode != HitMode.Hover || hitMode == HitMode.None) return;
|
||||
if (hitMode != HitMode.Hover) return;
|
||||
|
||||
SwitchPoptip(false);
|
||||
}
|
||||
@@ -303,7 +303,7 @@ namespace HandyControl.Controls
|
||||
private void Element_GotFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var hitMode = GetIsInstance(Target) ? HitMode : GetHitMode(Target);
|
||||
if (hitMode != HitMode.Focus || hitMode == HitMode.None) return;
|
||||
if (hitMode != HitMode.Focus) return;
|
||||
|
||||
SwitchPoptip(true);
|
||||
}
|
||||
@@ -311,7 +311,7 @@ namespace HandyControl.Controls
|
||||
private void Element_LostFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var hitMode = GetIsInstance(Target) ? HitMode : GetHitMode(Target);
|
||||
if (hitMode != HitMode.Focus || hitMode == HitMode.None) return;
|
||||
if (hitMode != HitMode.Focus) return;
|
||||
|
||||
SwitchPoptip(false);
|
||||
}
|
||||
|
||||
@@ -11,10 +11,14 @@ namespace HandyControl.Controls
|
||||
{
|
||||
private FrameworkElement _contentPresenter;
|
||||
|
||||
private static Storyboard StoryboardBuildInDefault;
|
||||
|
||||
private Storyboard _storyboardBuildIn;
|
||||
|
||||
public TransitioningContentControl()
|
||||
{
|
||||
Loaded += TransitioningContentControl_Loaded;
|
||||
IsVisibleChanged += TransitioningContentControl_IsVisibleChanged;
|
||||
Unloaded += TransitioningContentControl_Unloaded;
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty TransitionModeProperty = DependencyProperty.Register(
|
||||
@@ -23,7 +27,13 @@ namespace HandyControl.Controls
|
||||
private static void OnTransitionModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (TransitioningContentControl) d;
|
||||
ctl.StartTransition();
|
||||
ctl.OnTransitionModeChanged((TransitionMode) e.NewValue);
|
||||
}
|
||||
|
||||
private void OnTransitionModeChanged(TransitionMode newValue)
|
||||
{
|
||||
_storyboardBuildIn = ResourceHelper.GetResourceInternal<Storyboard>($"{newValue}Transition");
|
||||
StartTransition();
|
||||
}
|
||||
|
||||
public TransitionMode TransitionMode
|
||||
@@ -43,19 +53,33 @@ namespace HandyControl.Controls
|
||||
|
||||
private void TransitioningContentControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) => StartTransition();
|
||||
|
||||
private void TransitioningContentControl_Loaded(object sender, RoutedEventArgs e) => StartTransition();
|
||||
private void TransitioningContentControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
StartTransition();
|
||||
IsVisibleChanged += TransitioningContentControl_IsVisibleChanged;
|
||||
}
|
||||
|
||||
private void TransitioningContentControl_Unloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
IsVisibleChanged -= TransitioningContentControl_IsVisibleChanged;
|
||||
}
|
||||
|
||||
private void StartTransition()
|
||||
{
|
||||
if (Visibility != Visibility.Visible || _contentPresenter == null) return;
|
||||
if (!IsArrangeValid || _contentPresenter == null) return;
|
||||
|
||||
if (TransitionStoryboard != null)
|
||||
{
|
||||
TransitionStoryboard.Begin(_contentPresenter);
|
||||
}
|
||||
else if (Application.Current != null)
|
||||
else if (_storyboardBuildIn != null)
|
||||
{
|
||||
ResourceHelper.GetResource<Storyboard>($"{TransitionMode.ToString()}Transition")?.Begin(_contentPresenter);
|
||||
_storyboardBuildIn?.Begin(_contentPresenter);
|
||||
}
|
||||
else
|
||||
{
|
||||
StoryboardBuildInDefault ??= ResourceHelper.GetResourceInternal<Storyboard>($"{default(TransitionMode)}Transition");
|
||||
StoryboardBuildInDefault?.Begin(_contentPresenter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Tools;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class ElementGroup : SimpleStackPanel
|
||||
{
|
||||
private static readonly Dictionary<Orientation, Dictionary<ChildLocation, CornerRadius>> CornerRadiusDict;
|
||||
|
||||
static ElementGroup()
|
||||
{
|
||||
var defaultCornerRadius = ResourceHelper.GetResourceInternal<CornerRadius>("DefaultCornerRadius");
|
||||
|
||||
CornerRadiusDict = new Dictionary<Orientation, Dictionary<ChildLocation, CornerRadius>>
|
||||
{
|
||||
[Orientation.Horizontal] = new()
|
||||
{
|
||||
[ChildLocation.Single] = defaultCornerRadius,
|
||||
[ChildLocation.First] = new CornerRadius(defaultCornerRadius.TopLeft, 0, 0, defaultCornerRadius.BottomLeft),
|
||||
[ChildLocation.Middle] = new CornerRadius(),
|
||||
[ChildLocation.Last] = new CornerRadius(0, defaultCornerRadius.TopRight, defaultCornerRadius.BottomRight, 0)
|
||||
},
|
||||
[Orientation.Vertical] = new()
|
||||
{
|
||||
[ChildLocation.Single] = defaultCornerRadius,
|
||||
[ChildLocation.First] = new CornerRadius(defaultCornerRadius.TopLeft, defaultCornerRadius.TopRight, 0, 0),
|
||||
[ChildLocation.Middle] = new CornerRadius(),
|
||||
[ChildLocation.Last] = new CornerRadius(0, 0, defaultCornerRadius.BottomRight, defaultCornerRadius.BottomLeft)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved)
|
||||
{
|
||||
base.OnVisualChildrenChanged(visualAdded, visualRemoved);
|
||||
|
||||
if (visualAdded is UIElement elementAdded)
|
||||
{
|
||||
elementAdded.GotFocus += ElementAdded_GotFocus;
|
||||
elementAdded.LostFocus += ElementAdded_LostFocus;
|
||||
}
|
||||
|
||||
if (visualRemoved is UIElement elementRemoved)
|
||||
{
|
||||
elementRemoved.GotFocus -= ElementAdded_GotFocus;
|
||||
elementRemoved.LostFocus -= ElementAdded_LostFocus;
|
||||
}
|
||||
|
||||
var childrenCount = InternalChildren.Count;
|
||||
if (childrenCount == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var orientation = Orientation;
|
||||
|
||||
if (childrenCount == 1)
|
||||
{
|
||||
UpdateChildCornerRadius(InternalChildren[0], CornerRadiusDict[orientation][ChildLocation.Single]);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateChildCornerRadius(InternalChildren[0], CornerRadiusDict[orientation][ChildLocation.First]);
|
||||
|
||||
var childMargin = orientation == Orientation.Horizontal
|
||||
? new Thickness(-1, 0, 0, 0)
|
||||
: new Thickness(0, -1, 0, 0);
|
||||
|
||||
for (var childIndex = 1; childIndex < childrenCount; childIndex++)
|
||||
{
|
||||
var child = InternalChildren[childIndex];
|
||||
child.SetCurrentValue(MarginProperty, childMargin);
|
||||
UpdateChildCornerRadius(child, CornerRadiusDict[orientation][ChildLocation.Middle]);
|
||||
}
|
||||
|
||||
var lastChild = InternalChildren[childrenCount - 1];
|
||||
lastChild.SetCurrentValue(MarginProperty, childMargin);
|
||||
UpdateChildCornerRadius(lastChild, CornerRadiusDict[orientation][ChildLocation.Last]);
|
||||
}
|
||||
}
|
||||
|
||||
private static void UpdateChildCornerRadius(DependencyObject child, CornerRadius cornerRadius)
|
||||
{
|
||||
if (child is Border border)
|
||||
{
|
||||
border.SetCurrentValue(Border.CornerRadiusProperty, cornerRadius);
|
||||
}
|
||||
else
|
||||
{
|
||||
BorderElement.SetCornerRadius(child, cornerRadius);
|
||||
}
|
||||
}
|
||||
|
||||
private void ElementAdded_LostFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is UIElement element)
|
||||
{
|
||||
SetZIndex(element, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private void ElementAdded_GotFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is UIElement element)
|
||||
{
|
||||
SetZIndex(element, int.MaxValue);
|
||||
}
|
||||
}
|
||||
|
||||
private enum ChildLocation
|
||||
{
|
||||
Single,
|
||||
First,
|
||||
Middle,
|
||||
Last
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private int _lineCount;
|
||||
|
||||
private readonly List<FlexItemInfo> _orderList = new List<FlexItemInfo>();
|
||||
private readonly List<FlexItemInfo> _orderList = new();
|
||||
|
||||
#region Item
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace HandyControl.Controls
|
||||
curLineSize = sz;
|
||||
_lineCount++;
|
||||
|
||||
if (MathHelper.GreaterThan(sz.U, _uvConstraint.U)) //the element is wider then the constrint - give it a separate line
|
||||
if (MathHelper.GreaterThan(sz.U, _uvConstraint.U)) //the element is wider then the constrint - give it a separate line
|
||||
{
|
||||
panelSize.U = Math.Max(sz.U, panelSize.U);
|
||||
panelSize.V += sz.V;
|
||||
@@ -260,7 +260,7 @@ namespace HandyControl.Controls
|
||||
lineIndex++;
|
||||
curLineSizeArr[lineIndex] = sz;
|
||||
|
||||
if (MathHelper.GreaterThan(sz.U, uvFinalSize.U)) //the element is wider then the constraint - give it a separate line
|
||||
if (MathHelper.GreaterThan(sz.U, uvFinalSize.U)) //the element is wider then the constraint - give it a separate line
|
||||
{
|
||||
//switch to next line which only contain one element
|
||||
lastInLineArr[lineIndex] = i;
|
||||
@@ -399,7 +399,7 @@ namespace HandyControl.Controls
|
||||
lineIndex++;
|
||||
itemsU = 0;
|
||||
|
||||
if (i >= lastInLineArr[lineIndex]) //the element is wider then the constraint - give it a separate line
|
||||
if (i >= lastInLineArr[lineIndex]) //the element is wider then the constraint - give it a separate line
|
||||
{
|
||||
//switch to next line which only contain one element
|
||||
ArrangeLine(new FlexLineInfo
|
||||
@@ -507,7 +507,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
flexGrowItem = constraintFreeU / flexGrowSum;
|
||||
lineInfo.ScaleU = 1;
|
||||
lineFreeU = 0; //line free U was used up
|
||||
lineFreeU = 0; //line free U was used up
|
||||
}
|
||||
|
||||
for (var i = 0; i < itemCount; i++)
|
||||
@@ -543,7 +543,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
flexShrinkItem = constraintFreeU / flexShrinkSum;
|
||||
lineInfo.ScaleU = 1;
|
||||
lineFreeU = 0; //line free U was used up
|
||||
lineFreeU = 0; //line free U was used up
|
||||
}
|
||||
|
||||
for (var i = 0; i < itemCount; i++)
|
||||
@@ -648,7 +648,12 @@ namespace HandyControl.Controls
|
||||
|
||||
public int Index { get; }
|
||||
|
||||
public int CompareTo(FlexItemInfo other) => Order.CompareTo(other.Order);
|
||||
public int CompareTo(FlexItemInfo other)
|
||||
{
|
||||
var orderCompare = Order.CompareTo(other.Order);
|
||||
if (orderCompare != 0) return orderCompare;
|
||||
return Index.CompareTo(other.Index);
|
||||
}
|
||||
}
|
||||
|
||||
private struct FlexLineInfo
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace HandyControl.Controls
|
||||
private static bool OnSpanValidate(object value)
|
||||
{
|
||||
var v = (int) value;
|
||||
return v >= 1 && v <= 24;
|
||||
return v is >= 1 and <= 24;
|
||||
}
|
||||
|
||||
public int Span
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace HandyControl.Controls
|
||||
return double.IsNaN(v) || v >= 0.0d && !double.IsPositiveInfinity(v);
|
||||
}
|
||||
|
||||
private void ArrangeLine(double v, double lineV, int start, int end, bool useItemU, double itemU, double spacing)
|
||||
private void ArrangeWrapLine(double v, double lineV, int start, int end, bool useItemU, double itemU, double spacing)
|
||||
{
|
||||
double u = 0;
|
||||
var isHorizontal = _orientation == Orientation.Horizontal;
|
||||
@@ -104,6 +104,26 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
|
||||
private void ArrangeLine(double lineV, bool useItemU, double itemU, double spacing)
|
||||
{
|
||||
double u = 0;
|
||||
var isHorizontal = _orientation == Orientation.Horizontal;
|
||||
|
||||
var children = InternalChildren;
|
||||
for (var i = 0; i < children.Count; i++)
|
||||
{
|
||||
var child = children[i];
|
||||
if (child == null) continue;
|
||||
|
||||
var childSize = new UVSize(_orientation, child.DesiredSize.Width, child.DesiredSize.Height);
|
||||
var layoutSlotU = useItemU ? itemU : childSize.U;
|
||||
|
||||
child.Arrange(isHorizontal ? new Rect(u, 0, layoutSlotU, lineV) : new Rect(0, u, lineV, layoutSlotU));
|
||||
|
||||
u += layoutSlotU + spacing;
|
||||
}
|
||||
}
|
||||
|
||||
protected override Size MeasureOverride(Size constraint)
|
||||
{
|
||||
var curLineSize = new UVSize(_orientation);
|
||||
@@ -123,35 +143,69 @@ namespace HandyControl.Controls
|
||||
var children = InternalChildren;
|
||||
var isFirst = true;
|
||||
|
||||
for (int i = 0, count = children.Count; i < count; i++)
|
||||
if (childWrapping == VisualWrapping.Wrap)
|
||||
{
|
||||
var child = children[i];
|
||||
if (child == null) continue;
|
||||
|
||||
child.Measure(childConstraint);
|
||||
|
||||
var sz = new UVSize(
|
||||
_orientation,
|
||||
itemWidthSet ? itemWidth : child.DesiredSize.Width,
|
||||
itemHeightSet ? itemHeight : child.DesiredSize.Height);
|
||||
|
||||
if (childWrapping == VisualWrapping.Wrap && MathHelper.GreaterThan(curLineSize.U + sz.U + spacing, uvConstraint.U))
|
||||
for (int i = 0, count = children.Count; i < count; i++)
|
||||
{
|
||||
panelSize.U = Math.Max(curLineSize.U, panelSize.U);
|
||||
panelSize.V += curLineSize.V + spacing;
|
||||
curLineSize = sz;
|
||||
var child = children[i];
|
||||
if (child == null) continue;
|
||||
|
||||
if (MathHelper.GreaterThan(sz.U, uvConstraint.U))
|
||||
child.Measure(childConstraint);
|
||||
|
||||
var sz = new UVSize(
|
||||
_orientation,
|
||||
itemWidthSet ? itemWidth : child.DesiredSize.Width,
|
||||
itemHeightSet ? itemHeight : child.DesiredSize.Height);
|
||||
|
||||
if (MathHelper.GreaterThan(curLineSize.U + sz.U + spacing, uvConstraint.U))
|
||||
{
|
||||
panelSize.U = Math.Max(sz.U, panelSize.U);
|
||||
panelSize.V += sz.V + spacing;
|
||||
curLineSize = new UVSize(_orientation);
|
||||
}
|
||||
panelSize.U = Math.Max(curLineSize.U, panelSize.U);
|
||||
panelSize.V += curLineSize.V + spacing;
|
||||
curLineSize = sz;
|
||||
|
||||
isFirst = true;
|
||||
if (MathHelper.GreaterThan(sz.U, uvConstraint.U))
|
||||
{
|
||||
panelSize.U = Math.Max(sz.U, panelSize.U);
|
||||
panelSize.V += sz.V + spacing;
|
||||
curLineSize = new UVSize(_orientation);
|
||||
}
|
||||
|
||||
isFirst = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
curLineSize.U += isFirst ? sz.U : sz.U + spacing;
|
||||
curLineSize.V = Math.Max(sz.V, curLineSize.V);
|
||||
|
||||
isFirst = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var layoutSlotSize = constraint;
|
||||
|
||||
if (_orientation == Orientation.Horizontal)
|
||||
{
|
||||
layoutSlotSize.Width = double.PositiveInfinity;
|
||||
}
|
||||
else
|
||||
{
|
||||
layoutSlotSize.Height = double.PositiveInfinity;
|
||||
}
|
||||
|
||||
for (int i = 0, count = children.Count; i < count; ++i)
|
||||
{
|
||||
var child = children[i];
|
||||
if (child == null) continue;
|
||||
|
||||
child.Measure(layoutSlotSize);
|
||||
|
||||
var sz = new UVSize(
|
||||
_orientation,
|
||||
itemWidthSet ? itemWidth : child.DesiredSize.Width,
|
||||
itemHeightSet ? itemHeight : child.DesiredSize.Height);
|
||||
|
||||
curLineSize.U += isFirst ? sz.U : sz.U + spacing;
|
||||
curLineSize.V = Math.Max(sz.V, curLineSize.V);
|
||||
|
||||
@@ -183,46 +237,53 @@ namespace HandyControl.Controls
|
||||
var children = InternalChildren;
|
||||
var isFirst = true;
|
||||
|
||||
for (int i = 0, count = children.Count; i < count; i++)
|
||||
if (childWrapping == VisualWrapping.Wrap)
|
||||
{
|
||||
var child = children[i];
|
||||
if (child == null) continue;
|
||||
|
||||
var sz = new UVSize(
|
||||
_orientation,
|
||||
itemWidthSet ? itemWidth : child.DesiredSize.Width,
|
||||
itemHeightSet ? itemHeight : child.DesiredSize.Height);
|
||||
|
||||
if (childWrapping == VisualWrapping.Wrap && MathHelper.GreaterThan(curLineSize.U + sz.U + spacing, uvFinalSize.U))
|
||||
for (int i = 0, count = children.Count; i < count; i++)
|
||||
{
|
||||
ArrangeLine(accumulatedV, curLineSize.V, firstInLine, i, useItemU, itemU, spacing);
|
||||
var child = children[i];
|
||||
if (child == null) continue;
|
||||
|
||||
accumulatedV += curLineSize.V + spacing;
|
||||
curLineSize = sz;
|
||||
var sz = new UVSize(
|
||||
_orientation,
|
||||
itemWidthSet ? itemWidth : child.DesiredSize.Width,
|
||||
itemHeightSet ? itemHeight : child.DesiredSize.Height);
|
||||
|
||||
if (MathHelper.GreaterThan(sz.U, uvFinalSize.U))
|
||||
if (MathHelper.GreaterThan(curLineSize.U + sz.U + spacing, uvFinalSize.U))
|
||||
{
|
||||
ArrangeLine(accumulatedV, sz.V, i, ++i, useItemU, itemU, spacing);
|
||||
ArrangeWrapLine(accumulatedV, curLineSize.V, firstInLine, i, useItemU, itemU, spacing);
|
||||
|
||||
accumulatedV += sz.V + spacing;
|
||||
curLineSize = new UVSize(_orientation);
|
||||
accumulatedV += curLineSize.V + spacing;
|
||||
curLineSize = sz;
|
||||
|
||||
if (MathHelper.GreaterThan(sz.U, uvFinalSize.U))
|
||||
{
|
||||
ArrangeWrapLine(accumulatedV, sz.V, i, ++i, useItemU, itemU, spacing);
|
||||
|
||||
accumulatedV += sz.V + spacing;
|
||||
curLineSize = new UVSize(_orientation);
|
||||
}
|
||||
|
||||
firstInLine = i;
|
||||
isFirst = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
curLineSize.U += isFirst ? sz.U : sz.U + spacing;
|
||||
curLineSize.V = Math.Max(sz.V, curLineSize.V);
|
||||
|
||||
firstInLine = i;
|
||||
isFirst = true;
|
||||
isFirst = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
curLineSize.U += isFirst ? sz.U : sz.U + spacing;
|
||||
curLineSize.V = Math.Max(sz.V, curLineSize.V);
|
||||
|
||||
isFirst = false;
|
||||
if (firstInLine < children.Count)
|
||||
{
|
||||
ArrangeWrapLine(accumulatedV, curLineSize.V, firstInLine, children.Count, useItemU, itemU, spacing);
|
||||
}
|
||||
}
|
||||
|
||||
if (firstInLine < children.Count)
|
||||
else
|
||||
{
|
||||
ArrangeLine(accumulatedV, curLineSize.V, firstInLine, children.Count, useItemU, itemU, spacing);
|
||||
ArrangeLine(uvFinalSize.V, useItemU, itemU, spacing);
|
||||
}
|
||||
|
||||
return finalSize;
|
||||
|
||||
+6
-6
@@ -14,9 +14,9 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public override FrameworkElement CreateElement(PropertyItem propertyItem) => new System.Windows.Controls.ComboBox
|
||||
{
|
||||
Style = ResourceHelper.GetResource<Style>("ComboBoxCapsule"),
|
||||
Style = ResourceHelper.GetResourceInternal<Style>("ComboBoxCapsule"),
|
||||
ItemsSource = Enum.GetValues(propertyItem.PropertyType),
|
||||
ItemTemplateSelector = ResourceHelper.GetResource<DataTemplateSelector>("HorizontalAlignmentPathTemplateSelector"),
|
||||
ItemTemplateSelector = ResourceHelper.GetResourceInternal<DataTemplateSelector>("HorizontalAlignmentPathTemplateSelector"),
|
||||
HorizontalAlignment = HorizontalAlignment.Left
|
||||
};
|
||||
|
||||
@@ -48,16 +48,16 @@ namespace HandyControl.Controls
|
||||
switch (horizontalAlignment)
|
||||
{
|
||||
case HorizontalAlignment.Left:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignLeftGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignLeftGeometry"));
|
||||
break;
|
||||
case HorizontalAlignment.Center:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignHCenterGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignHCenterGeometry"));
|
||||
break;
|
||||
case HorizontalAlignment.Right:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignRightGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignRightGeometry"));
|
||||
break;
|
||||
case HorizontalAlignment.Stretch:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignHStretchGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignHStretchGeometry"));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -15,6 +15,6 @@ namespace HandyControl.Controls
|
||||
|
||||
public override BindingMode GetBindingMode(PropertyItem propertyItem) => BindingMode.OneWay;
|
||||
|
||||
protected override IValueConverter GetConverter(PropertyItem propertyItem) => ResourceHelper.GetResource<IValueConverter>("Object2StringConverter");
|
||||
protected override IValueConverter GetConverter(PropertyItem propertyItem) => ResourceHelper.GetResourceInternal<IValueConverter>("Object2StringConverter");
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -8,7 +8,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public override FrameworkElement CreateElement(PropertyItem propertyItem) => new ToggleButton
|
||||
{
|
||||
Style = ResourceHelper.GetResource<Style>("ToggleButtonSwitch"),
|
||||
Style = ResourceHelper.GetResourceInternal<Style>("ToggleButtonSwitch"),
|
||||
HorizontalAlignment = HorizontalAlignment.Left,
|
||||
IsEnabled = !propertyItem.IsReadOnly
|
||||
};
|
||||
|
||||
+6
-6
@@ -14,9 +14,9 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public override FrameworkElement CreateElement(PropertyItem propertyItem) => new System.Windows.Controls.ComboBox
|
||||
{
|
||||
Style = ResourceHelper.GetResource<Style>("ComboBoxCapsule"),
|
||||
Style = ResourceHelper.GetResourceInternal<Style>("ComboBoxCapsule"),
|
||||
ItemsSource = Enum.GetValues(propertyItem.PropertyType),
|
||||
ItemTemplateSelector = ResourceHelper.GetResource<DataTemplateSelector>("VerticalAlignmentPathTemplateSelector"),
|
||||
ItemTemplateSelector = ResourceHelper.GetResourceInternal<DataTemplateSelector>("VerticalAlignmentPathTemplateSelector"),
|
||||
HorizontalAlignment = HorizontalAlignment.Left
|
||||
};
|
||||
|
||||
@@ -48,16 +48,16 @@ namespace HandyControl.Controls
|
||||
switch (verticalAlignment)
|
||||
{
|
||||
case VerticalAlignment.Top:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignTopGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignTopGeometry"));
|
||||
break;
|
||||
case VerticalAlignment.Center:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignVCenterGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignVCenterGeometry"));
|
||||
break;
|
||||
case VerticalAlignment.Bottom:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignBottomGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignBottomGeometry"));
|
||||
break;
|
||||
case VerticalAlignment.Stretch:
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResource<Geometry>("AlignVStretchGeometry"));
|
||||
factory.SetValue(Path.DataProperty, ResourceHelper.GetResourceInternal<Geometry>("AlignVStretchGeometry"));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.SortByName, SortByName, (s, e) => e.CanExecute = ShowSortButton));
|
||||
}
|
||||
|
||||
public virtual PropertyResolver PropertyResolver { get; } = new PropertyResolver();
|
||||
public virtual PropertyResolver PropertyResolver { get; } = new();
|
||||
|
||||
public static readonly RoutedEvent SelectedObjectChangedEvent =
|
||||
EventManager.RegisterRoutedEvent("SelectedObjectChanged", RoutingStrategy.Bubble,
|
||||
@@ -181,7 +181,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual PropertyItem CreatePropertyItem(PropertyDescriptor propertyDescriptor) => new PropertyItem
|
||||
protected virtual PropertyItem CreatePropertyItem(PropertyDescriptor propertyDescriptor) => new()
|
||||
{
|
||||
Category = PropertyResolver.ResolveCategory(propertyDescriptor),
|
||||
DisplayName = PropertyResolver.ResolveDisplayName(propertyDescriptor),
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public class PropertyResolver
|
||||
{
|
||||
private static readonly Dictionary<Type, EditorTypeCode> TypeCodeDic = new Dictionary<Type, EditorTypeCode>
|
||||
private static readonly Dictionary<Type, EditorTypeCode> TypeCodeDic = new()
|
||||
{
|
||||
[typeof(string)] = EditorTypeCode.PlainText,
|
||||
[typeof(sbyte)] = EditorTypeCode.SByteNumber,
|
||||
@@ -99,10 +99,10 @@ namespace HandyControl.Controls
|
||||
_ => new ReadOnlyTextPropertyEditor()
|
||||
}
|
||||
: type.IsSubclassOf(typeof(Enum))
|
||||
? (PropertyEditorBase) new EnumPropertyEditor()
|
||||
? new EnumPropertyEditor()
|
||||
: new ReadOnlyTextPropertyEditor();
|
||||
|
||||
public virtual PropertyEditorBase CreateEditor(Type type) => new ReadOnlyTextPropertyEditor();
|
||||
public virtual PropertyEditorBase CreateEditor(Type type) => Activator.CreateInstance(type) as PropertyEditorBase ?? new ReadOnlyTextPropertyEditor();
|
||||
|
||||
private enum EditorTypeCode
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private BitmapSource _imageSource;
|
||||
|
||||
private static readonly Guid BmpGuid = new Guid("{b96b3cab-0728-11d3-9d7b-0000f81ef32e}");
|
||||
private static readonly Guid BmpGuid = new("{b96b3cab-0728-11d3-9d7b-0000f81ef32e}");
|
||||
|
||||
#region const
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public ScreenshotWindow(Screenshot screenshot)
|
||||
{
|
||||
Style = ResourceHelper.GetResource<Style>(ResourceToken.Window4ScreenshotStyle);
|
||||
Style = ResourceHelper.GetResourceInternal<Style>(ResourceToken.Window4ScreenshotStyle);
|
||||
_screenshot = screenshot;
|
||||
DataContext = this;
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace HandyControl.Controls
|
||||
if (Role == SideMenuItemRole.Header && ItemsHost.Children.Count > 0)
|
||||
{
|
||||
var item = ItemsHost.Children.OfType<SideMenuItem>().FirstOrDefault();
|
||||
if (item != null && !item.IsSelected)
|
||||
if (item is { IsSelected: false })
|
||||
{
|
||||
item.OnSelected(new RoutedEventArgs(SelectedEvent, item));
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
layer.Remove(_adorner);
|
||||
}
|
||||
else if (_adorner != null && _adorner.Parent is AdornerLayer parent)
|
||||
else if (_adorner is { Parent: AdornerLayer parent })
|
||||
{
|
||||
parent.Remove(_adorner);
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ namespace HandyControl.Controls
|
||||
|
||||
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
|
||||
{
|
||||
if (IsMoveToPointEnabled && _track.ThumbStart != null && !_track.ThumbStart.IsMouseOver && _track.ThumbEnd != null && !_track.ThumbEnd.IsMouseOver)
|
||||
if (IsMoveToPointEnabled && _track.ThumbStart is { IsMouseOver: false } && _track.ThumbEnd is { IsMouseOver: false })
|
||||
{
|
||||
// Here we need to determine whether it's closer to the starting point or the end point.
|
||||
var pt = e.MouseDevice.GetPosition(_track);
|
||||
@@ -301,7 +301,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
// If ticks collection is available, use it.
|
||||
// Note that ticks may be unsorted.
|
||||
if (Ticks != null && Ticks.Count > 0)
|
||||
if (Ticks is { Count: > 0 })
|
||||
{
|
||||
foreach (var tick in Ticks)
|
||||
{
|
||||
@@ -341,7 +341,7 @@ namespace HandyControl.Controls
|
||||
var previous = Minimum;
|
||||
var next = Maximum;
|
||||
|
||||
if (Ticks != null && Ticks.Count > 0)
|
||||
if (Ticks is { Count: > 0 })
|
||||
{
|
||||
foreach (var tick in Ticks)
|
||||
{
|
||||
@@ -429,7 +429,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
// Show AutoToolTip if needed.
|
||||
|
||||
if (!(e.OriginalSource is RangeThumb thumb)) return;
|
||||
if (e.OriginalSource is not RangeThumb thumb) return;
|
||||
_thumbCurrent = thumb;
|
||||
_originThumbPoint = Mouse.GetPosition(_thumbCurrent);
|
||||
_thumbCurrent.StartDrag();
|
||||
@@ -531,7 +531,7 @@ namespace HandyControl.Controls
|
||||
|
||||
protected virtual void OnThumbDragDelta(DragDeltaEventArgs e)
|
||||
{
|
||||
if (!(e.OriginalSource is Thumb thumb)) return;
|
||||
if (e.OriginalSource is not Thumb thumb) return;
|
||||
var isStart = thumb.Equals(_track.ThumbStart);
|
||||
if (!isStart)
|
||||
{
|
||||
@@ -579,7 +579,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
// Show AutoToolTip if needed.
|
||||
|
||||
if (!(e.OriginalSource is Thumb thumb) || AutoToolTipPlacement == AutoToolTipPlacement.None)
|
||||
if (e.OriginalSource is not Thumb thumb || AutoToolTipPlacement == AutoToolTipPlacement.None)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -397,10 +397,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (oldValue != newValue)
|
||||
{
|
||||
if (_visualChildren == null)
|
||||
{
|
||||
_visualChildren = new Visual[5];
|
||||
}
|
||||
_visualChildren ??= new Visual[5];
|
||||
|
||||
if (oldValue != null)
|
||||
{
|
||||
|
||||
@@ -236,7 +236,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
for (var i = 0; i < Items.Count; i++)
|
||||
{
|
||||
if (!(ItemContainerGenerator.ContainerFromIndex(i) is TabItem item)) return;
|
||||
if (ItemContainerGenerator.ContainerFromIndex(i) is not TabItem item) return;
|
||||
item.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
|
||||
item.TabPanel = HeaderPanel;
|
||||
}
|
||||
@@ -321,7 +321,7 @@ namespace HandyControl.Controls
|
||||
_buttonOverflow.Menu.Items.Clear();
|
||||
for (var i = 0; i < Items.Count; i++)
|
||||
{
|
||||
if (!(ItemContainerGenerator.ContainerFromIndex(i) is TabItem item)) continue;
|
||||
if (ItemContainerGenerator.ContainerFromIndex(i) is not TabItem item) continue;
|
||||
|
||||
var menuItem = new MenuItem
|
||||
{
|
||||
@@ -350,14 +350,10 @@ namespace HandyControl.Controls
|
||||
{
|
||||
list.Remove(actualItem);
|
||||
list.Insert(0, actualItem);
|
||||
if (IsAnimationEnabled)
|
||||
{
|
||||
HeaderPanel.SetValue(TabPanel.FluidMoveDurationPropertyKey, new Duration(TimeSpan.FromMilliseconds(200)));
|
||||
}
|
||||
else
|
||||
{
|
||||
HeaderPanel.SetValue(TabPanel.FluidMoveDurationPropertyKey, new Duration(TimeSpan.FromMilliseconds(0)));
|
||||
}
|
||||
HeaderPanel.SetValue(TabPanel.FluidMoveDurationPropertyKey,
|
||||
IsAnimationEnabled
|
||||
? new Duration(TimeSpan.FromMilliseconds(200))
|
||||
: new Duration(TimeSpan.FromMilliseconds(0)));
|
||||
HeaderPanel.ForceUpdate = true;
|
||||
HeaderPanel.Measure(new Size(HeaderPanel.DesiredSize.Width, ActualHeight));
|
||||
HeaderPanel.ForceUpdate = false;
|
||||
@@ -396,7 +392,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
var argsClosing = new CancelRoutedEventArgs(TabItem.ClosingEvent, item);
|
||||
|
||||
if (!(ItemContainerGenerator.ContainerFromItem(item) is TabItem tabItem)) continue;
|
||||
if (ItemContainerGenerator.ContainerFromItem(item) is not TabItem tabItem) continue;
|
||||
|
||||
tabItem.RaiseEvent(argsClosing);
|
||||
if (argsClosing.Cancel) return;
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace HandyControl.Controls
|
||||
menu.SetBinding(VisibilityProperty, new Binding(ShowContextMenuProperty.Name)
|
||||
{
|
||||
Source = this,
|
||||
Converter = ResourceHelper.GetResource<IValueConverter>(ResourceToken.Boolean2VisibilityConverter)
|
||||
Converter = ResourceHelper.GetResourceInternal<IValueConverter>(ResourceToken.Boolean2VisibilityConverter)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace HandyControl.Controls
|
||||
/// <summary>
|
||||
/// 选项卡字典
|
||||
/// </summary>
|
||||
internal Dictionary<int, TabItem> ItemDic = new Dictionary<int, TabItem>();
|
||||
internal Dictionary<int, TabItem> ItemDic = new();
|
||||
|
||||
public static readonly DependencyPropertyKey FluidMoveDurationPropertyKey =
|
||||
DependencyProperty.RegisterReadOnly("FluidMoveDuration", typeof(Duration), typeof(TabPanel),
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools.Helper;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
@@ -201,27 +201,8 @@ namespace HandyControl.Controls
|
||||
return;
|
||||
}
|
||||
|
||||
#if NET40 || NET45 || NET451 || NET452 || NET46|| NET461
|
||||
_formattedText = new FormattedText(
|
||||
Text,
|
||||
CultureInfo.CurrentUICulture,
|
||||
FlowDirection,
|
||||
new Typeface(FontFamily, FontStyle, FontWeight, FontStretch),
|
||||
FontSize, Fill);
|
||||
#else
|
||||
var source = PresentationSource.FromVisual(this);
|
||||
var dpi = 1.0;
|
||||
if (source?.CompositionTarget != null)
|
||||
{
|
||||
dpi = 96.0 * source.CompositionTarget.TransformToDevice.M11 / 96.0;
|
||||
}
|
||||
_formattedText = new FormattedText(
|
||||
Text,
|
||||
CultureInfo.CurrentUICulture,
|
||||
FlowDirection,
|
||||
new Typeface(FontFamily, FontStyle, FontWeight, FontStretch),
|
||||
FontSize, Fill, dpi);
|
||||
#endif
|
||||
_formattedText = TextHelper.CreateFormattedText(Text, FlowDirection,
|
||||
new Typeface(FontFamily, FontStyle, FontWeight, FontStretch), FontSize);
|
||||
|
||||
UpdateFormattedText();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools.Helper;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
@@ -129,27 +129,8 @@ namespace HandyControl.Controls
|
||||
return;
|
||||
}
|
||||
|
||||
#if NET40 || NET45 || NET451 || NET452 || NET46|| NET461
|
||||
_formattedText = new FormattedText(
|
||||
Text,
|
||||
CultureInfo.CurrentUICulture,
|
||||
FlowDirection,
|
||||
new Typeface(FontFamily, FontStyle, FontWeight, FontStretch),
|
||||
FontSize, Foreground);
|
||||
#else
|
||||
var source = PresentationSource.FromVisual(this);
|
||||
var dpi = 1.0;
|
||||
if (source?.CompositionTarget != null)
|
||||
{
|
||||
dpi = 96.0 * source.CompositionTarget.TransformToDevice.M11 / 96.0;
|
||||
}
|
||||
_formattedText = new FormattedText(
|
||||
Text,
|
||||
CultureInfo.CurrentUICulture,
|
||||
FlowDirection,
|
||||
new Typeface(FontFamily, FontStyle, FontWeight, FontStretch),
|
||||
FontSize, Foreground, dpi);
|
||||
#endif
|
||||
_formattedText = TextHelper.CreateFormattedText(Text, FlowDirection,
|
||||
new Typeface(FontFamily, FontStyle, FontWeight, FontStretch), FontSize);
|
||||
|
||||
UpdateFormattedText();
|
||||
}
|
||||
|
||||
@@ -173,11 +173,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
if (_isHandlerSuspended == null)
|
||||
{
|
||||
_isHandlerSuspended = new Dictionary<DependencyProperty, bool>(2);
|
||||
}
|
||||
|
||||
_isHandlerSuspended ??= new Dictionary<DependencyProperty, bool>(2);
|
||||
_isHandlerSuspended[property] = true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
@@ -110,6 +111,7 @@ namespace HandyControl.Controls
|
||||
selector.ItemsSource = list;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MergeIntoPattern")]
|
||||
private void Update()
|
||||
{
|
||||
if (_hourList.SelectedIndex >= 0 && _hourList.SelectedIndex < 24 &&
|
||||
|
||||
@@ -240,10 +240,10 @@ namespace HandyControl.Controls
|
||||
|
||||
var positions = new Point3DCollection
|
||||
{
|
||||
new Point3D(-quarterWidth * flag, quarterHeight, 0),
|
||||
new Point3D(-quarterWidth * flag, 0, 0),
|
||||
new Point3D(quarterWidth * flag, 0, 0),
|
||||
new Point3D(quarterWidth * flag, quarterHeight, 0)
|
||||
new(-quarterWidth * flag, quarterHeight, 0),
|
||||
new(-quarterWidth * flag, 0, 0),
|
||||
new(quarterWidth * flag, 0, 0),
|
||||
new(quarterWidth * flag, quarterHeight, 0)
|
||||
};
|
||||
|
||||
var triangleIndices = new Int32Collection
|
||||
@@ -258,10 +258,10 @@ namespace HandyControl.Controls
|
||||
|
||||
var textureCoordinates = new PointCollection
|
||||
{
|
||||
new Point(0, 0),
|
||||
new Point(0, 1),
|
||||
new Point(1, 1),
|
||||
new Point(1, 0)
|
||||
new(0, 0),
|
||||
new(0, 1),
|
||||
new(1, 1),
|
||||
new(1, 0)
|
||||
};
|
||||
|
||||
var geometry3D = new MeshGeometry3D
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnSelectedTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is TimeBar timeBar && timeBar._textBlockSelected != null)
|
||||
if (d is TimeBar { _textBlockSelected: { } } timeBar)
|
||||
{
|
||||
timeBar.OnSelectedTimeChanged((DateTime) e.NewValue);
|
||||
}
|
||||
@@ -150,7 +150,7 @@ namespace HandyControl.Controls
|
||||
/// <summary>
|
||||
/// 刻度集合
|
||||
/// </summary>
|
||||
private readonly List<SpeTextBlock> _speBlockList = new List<SpeTextBlock>();
|
||||
private readonly List<SpeTextBlock> _speBlockList = new();
|
||||
|
||||
/// <summary>
|
||||
/// 初始化时时间
|
||||
@@ -160,7 +160,7 @@ namespace HandyControl.Controls
|
||||
/// <summary>
|
||||
/// 时间段集合
|
||||
/// </summary>
|
||||
private readonly List<int> _timeSpeList = new List<int>
|
||||
private readonly List<int> _timeSpeList = new()
|
||||
{
|
||||
7200000,
|
||||
3600000,
|
||||
@@ -403,25 +403,17 @@ namespace HandyControl.Controls
|
||||
/// <returns></returns>
|
||||
private DateTime TimeConvert(DateTime time)
|
||||
{
|
||||
switch (_speIndex)
|
||||
return _speIndex switch
|
||||
{
|
||||
case 0:
|
||||
return new DateTime(time.Year, time.Month, time.Day, time.Hour / 2 * 2, 0, 0);
|
||||
case 1:
|
||||
return new DateTime(time.Year, time.Month, time.Day, time.Hour, 0, 0);
|
||||
case 2:
|
||||
return new DateTime(time.Year, time.Month, time.Day, time.Hour, time.Minute / 30 * 30, 0);
|
||||
case 3:
|
||||
return new DateTime(time.Year, time.Month, time.Day, time.Hour, time.Minute / 10 * 10, 0);
|
||||
case 4:
|
||||
return new DateTime(time.Year, time.Month, time.Day, time.Hour, time.Minute / 5 * 5, 0);
|
||||
case 5:
|
||||
return new DateTime(time.Year, time.Month, time.Day, time.Hour, time.Minute, 0);
|
||||
case 6:
|
||||
return new DateTime(time.Year, time.Month, time.Day, time.Hour, time.Minute, time.Second / 30 * 30);
|
||||
default:
|
||||
return time;
|
||||
}
|
||||
0 => new DateTime(time.Year, time.Month, time.Day, time.Hour / 2 * 2, 0, 0),
|
||||
1 => new DateTime(time.Year, time.Month, time.Day, time.Hour, 0, 0),
|
||||
2 => new DateTime(time.Year, time.Month, time.Day, time.Hour, time.Minute / 30 * 30, 0),
|
||||
3 => new DateTime(time.Year, time.Month, time.Day, time.Hour, time.Minute / 10 * 10, 0),
|
||||
4 => new DateTime(time.Year, time.Month, time.Day, time.Hour, time.Minute / 5 * 5, 0),
|
||||
5 => new DateTime(time.Year, time.Month, time.Day, time.Hour, time.Minute, 0),
|
||||
6 => new DateTime(time.Year, time.Month, time.Day, time.Hour, time.Minute, time.Second / 30 * 30),
|
||||
_ => time
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -22,9 +22,9 @@ namespace HandyControl.Controls
|
||||
|
||||
private const string ElementItemsSelected = "PART_ItemsSelected";
|
||||
|
||||
private readonly Dictionary<object, TransferEntry> _entryDic = new Dictionary<object, TransferEntry>();
|
||||
private readonly Dictionary<object, TransferEntry> _entryDic = new();
|
||||
|
||||
private readonly List<TransferEntry> _entryList = new List<TransferEntry>();
|
||||
private readonly List<TransferEntry> _entryList = new();
|
||||
|
||||
private SimpleItemsControl _itemsOrigin;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools;
|
||||
using HandyControl.Tools.Helper;
|
||||
using HandyControl.Tools.Interop;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
@@ -14,36 +14,32 @@ namespace HandyControl.Controls
|
||||
EnableBlur(this);
|
||||
}
|
||||
|
||||
private static SystemVersionInfo GetSystemVersionInfo()
|
||||
{
|
||||
var osv = new InteropValues.RTL_OSVERSIONINFOEX();
|
||||
osv.dwOSVersionInfoSize = (uint) Marshal.SizeOf(osv);
|
||||
InteropMethods.Gdip.RtlGetVersion(out osv);
|
||||
return new SystemVersionInfo((int) osv.dwMajorVersion, (int) osv.dwMinorVersion, (int) osv.dwBuildNumber);
|
||||
}
|
||||
|
||||
internal static void EnableBlur(Window window)
|
||||
{
|
||||
var versionInfo = GetSystemVersionInfo();
|
||||
|
||||
if (versionInfo < SystemVersionInfo.Windows10 ||
|
||||
versionInfo >= SystemVersionInfo.Windows10_1903)
|
||||
{
|
||||
var colorValue = ResourceHelper.GetResource<uint>(ResourceToken.BlurGradientValue);
|
||||
var color = ColorHelper.ToColor(colorValue);
|
||||
color = Color.FromRgb(color.R, color.G, color.B);
|
||||
window.Background = new SolidColorBrush(color);
|
||||
return;
|
||||
}
|
||||
var versionInfo = SystemHelper.GetSystemVersionInfo();
|
||||
|
||||
var accentPolicy = new InteropValues.ACCENTPOLICY();
|
||||
var accentPolicySize = Marshal.SizeOf(accentPolicy);
|
||||
|
||||
accentPolicy.AccentState = versionInfo < SystemVersionInfo.Windows10_1809
|
||||
? InteropValues.ACCENTSTATE.ACCENT_ENABLE_BLURBEHIND
|
||||
: InteropValues.ACCENTSTATE.ACCENT_ENABLE_ACRYLICBLURBEHIND;
|
||||
|
||||
accentPolicy.AccentFlags = 2;
|
||||
|
||||
if (versionInfo >= SystemVersionInfo.Windows10_1903)
|
||||
{
|
||||
accentPolicy.AccentState = InteropValues.ACCENTSTATE.ACCENT_ENABLE_BLURBEHIND;
|
||||
}
|
||||
else if (versionInfo >= SystemVersionInfo.Windows10_1809)
|
||||
{
|
||||
accentPolicy.AccentState = InteropValues.ACCENTSTATE.ACCENT_ENABLE_ACRYLICBLURBEHIND;
|
||||
}
|
||||
else if (versionInfo >= SystemVersionInfo.Windows10)
|
||||
{
|
||||
accentPolicy.AccentState = InteropValues.ACCENTSTATE.ACCENT_ENABLE_BLURBEHIND;
|
||||
}
|
||||
else
|
||||
{
|
||||
accentPolicy.AccentState = InteropValues.ACCENTSTATE.ACCENT_ENABLE_TRANSPARENTGRADIENT;
|
||||
}
|
||||
|
||||
accentPolicy.GradientColor = ResourceHelper.GetResource<uint>(ResourceToken.BlurGradientValue);
|
||||
|
||||
var accentPtr = Marshal.AllocHGlobal(accentPolicySize);
|
||||
|
||||
@@ -248,8 +248,8 @@ namespace HandyControl.Controls
|
||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.OK);
|
||||
SetButtonStatus(messageBox, MessageBoxButton.OK, MessageBoxResult.OK);
|
||||
messageBox.ShowImage = true;
|
||||
messageBox.Image = ResourceHelper.GetResource<Geometry>(ResourceToken.SuccessGeometry);
|
||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(ResourceToken.SuccessBrush);
|
||||
messageBox.Image = ResourceHelper.GetResourceInternal<Geometry>(ResourceToken.SuccessGeometry);
|
||||
messageBox.ImageBrush = ResourceHelper.GetResourceInternal<Brush>(ResourceToken.SuccessBrush);
|
||||
SystemSounds.Asterisk.Play();
|
||||
messageBox.ShowDialog();
|
||||
}));
|
||||
@@ -330,8 +330,8 @@ namespace HandyControl.Controls
|
||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.OK);
|
||||
SetButtonStatus(messageBox, MessageBoxButton.OK, MessageBoxResult.OK);
|
||||
messageBox.ShowImage = true;
|
||||
messageBox.Image = ResourceHelper.GetResource<Geometry>(ResourceToken.FatalGeometry);
|
||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(ResourceToken.PrimaryTextBrush);
|
||||
messageBox.Image = ResourceHelper.GetResourceInternal<Geometry>(ResourceToken.FatalGeometry);
|
||||
messageBox.ImageBrush = ResourceHelper.GetResourceInternal<Brush>(ResourceToken.PrimaryTextBrush);
|
||||
SystemSounds.Asterisk.Play();
|
||||
messageBox.ShowDialog();
|
||||
}));
|
||||
@@ -375,13 +375,13 @@ namespace HandyControl.Controls
|
||||
if (!string.IsNullOrEmpty(info.IconKey))
|
||||
{
|
||||
messageBox.ShowImage = true;
|
||||
messageBox.Image = ResourceHelper.GetResource<Geometry>(info.IconKey);
|
||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(info.IconBrushKey);
|
||||
messageBox.Image = ResourceHelper.GetResourceInternal<Geometry>(info.IconKey);
|
||||
messageBox.ImageBrush = ResourceHelper.GetResourceInternal<Brush>(info.IconBrushKey);
|
||||
}
|
||||
|
||||
if (info.StyleKey != null)
|
||||
{
|
||||
messageBox.Style = ResourceHelper.GetResource<Style>(info.StyleKey);
|
||||
messageBox.Style = ResourceHelper.GetResourceInternal<Style>(info.StyleKey);
|
||||
}
|
||||
SystemSounds.Asterisk.Play();
|
||||
messageBox.ShowDialog();
|
||||
@@ -477,7 +477,7 @@ namespace HandyControl.Controls
|
||||
IsDefault = true,
|
||||
Content = Lang.Confirm,
|
||||
Command = ControlCommands.Confirm,
|
||||
Style = ResourceHelper.GetResource<Style>("MessageBoxButtonStyle")
|
||||
Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxButtonStyle")
|
||||
};
|
||||
|
||||
break;
|
||||
@@ -499,15 +499,15 @@ namespace HandyControl.Controls
|
||||
|
||||
if (defaultResult == MessageBoxResult.Cancel)
|
||||
{
|
||||
messageBox._buttonOk.Style = ResourceHelper.GetResource<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonCancel.Style = ResourceHelper.GetResource<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonOk.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonCancel.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonCancel.IsDefault = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
messageBox._buttonOk.Style = ResourceHelper.GetResource<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonOk.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonOk.IsDefault = true;
|
||||
messageBox._buttonCancel.Style = ResourceHelper.GetResource<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonCancel.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxButtonStyle");
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -528,15 +528,15 @@ namespace HandyControl.Controls
|
||||
|
||||
if (defaultResult == MessageBoxResult.No)
|
||||
{
|
||||
messageBox._buttonYes.Style = ResourceHelper.GetResource<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonNo.Style = ResourceHelper.GetResource<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonYes.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonNo.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonNo.IsDefault = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
messageBox._buttonYes.Style = ResourceHelper.GetResource<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonYes.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonYes.IsDefault = true;
|
||||
messageBox._buttonNo.Style = ResourceHelper.GetResource<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonNo.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxButtonStyle");
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -565,24 +565,24 @@ namespace HandyControl.Controls
|
||||
|
||||
if (defaultResult == MessageBoxResult.No)
|
||||
{
|
||||
messageBox._buttonYes.Style = ResourceHelper.GetResource<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonNo.Style = ResourceHelper.GetResource<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonYes.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonNo.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonNo.IsDefault = true;
|
||||
messageBox._buttonCancel.Style = ResourceHelper.GetResource<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonCancel.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxButtonStyle");
|
||||
}
|
||||
else if (defaultResult == MessageBoxResult.Cancel)
|
||||
{
|
||||
messageBox._buttonYes.Style = ResourceHelper.GetResource<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonNo.Style = ResourceHelper.GetResource<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonCancel.Style = ResourceHelper.GetResource<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonYes.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonNo.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonCancel.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonCancel.IsDefault = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
messageBox._buttonYes.Style = ResourceHelper.GetResource<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonYes.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxPrimaryButtonStyle");
|
||||
messageBox._buttonYes.IsDefault = true;
|
||||
messageBox._buttonNo.Style = ResourceHelper.GetResource<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonCancel.Style = ResourceHelper.GetResource<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonNo.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxButtonStyle");
|
||||
messageBox._buttonCancel.Style = ResourceHelper.GetResourceInternal<Style>("MessageBoxButtonStyle");
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -616,8 +616,8 @@ namespace HandyControl.Controls
|
||||
|
||||
if (string.IsNullOrEmpty(iconKey)) return;
|
||||
messageBox.ShowImage = true;
|
||||
messageBox.Image = ResourceHelper.GetResource<Geometry>(iconKey);
|
||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(iconBrushKey);
|
||||
messageBox.Image = ResourceHelper.GetResourceInternal<Geometry>(iconKey);
|
||||
messageBox.ImageBrush = ResourceHelper.GetResourceInternal<Brush>(iconBrushKey);
|
||||
}
|
||||
|
||||
private static bool IsValidMessageBoxButton(MessageBoxButton value)
|
||||
@@ -628,6 +628,7 @@ namespace HandyControl.Controls
|
||||
|| value == MessageBoxButton.YesNoCancel;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "ConditionIsAlwaysTrueOrFalse")]
|
||||
private static bool IsValidMessageBoxImage(MessageBoxImage value)
|
||||
{
|
||||
return value == MessageBoxImage.Asterisk
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace HandyControl.Controls
|
||||
WindowStyle = WindowStyle.None,
|
||||
ContentStr = message,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen,
|
||||
Background = ResourceHelper.GetResource<Brush>(ResourceToken.PrimaryBrush)
|
||||
Background = ResourceHelper.GetResourceInternal<Brush>(ResourceToken.PrimaryBrush)
|
||||
};
|
||||
window.Show();
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace HandyControl.Controls
|
||||
|
||||
static Window()
|
||||
{
|
||||
StyleProperty.OverrideMetadata(typeof(Window), new FrameworkPropertyMetadata(ResourceHelper.GetResource<Style>(ResourceToken.WindowWin10)));
|
||||
StyleProperty.OverrideMetadata(typeof(Window), new FrameworkPropertyMetadata(ResourceHelper.GetResourceInternal<Style>(ResourceToken.WindowWin10)));
|
||||
}
|
||||
|
||||
public Window()
|
||||
|
||||
@@ -8,11 +8,11 @@ namespace HandyControl.Data
|
||||
|
||||
public Guid Guid { get; }
|
||||
|
||||
public static GifFrameDimension Time { get; } = new GifFrameDimension(new Guid("{6aedbd6d-3fb5-418a-83a6-7f45229dc872}"));
|
||||
public static GifFrameDimension Time { get; } = new(new Guid("{6aedbd6d-3fb5-418a-83a6-7f45229dc872}"));
|
||||
|
||||
public static GifFrameDimension Resolution { get; } = new GifFrameDimension(new Guid("{84236f7b-3bd3-428f-8dab-4ea1439ca315}"));
|
||||
public static GifFrameDimension Resolution { get; } = new(new Guid("{84236f7b-3bd3-428f-8dab-4ea1439ca315}"));
|
||||
|
||||
public static GifFrameDimension Page { get; } = new GifFrameDimension(new Guid("{7462dc86-6180-4c7e-8e3f-ee7333a7a483}"));
|
||||
public static GifFrameDimension Page { get; } = new(new Guid("{7462dc86-6180-4c7e-8e3f-ee7333a7a483}"));
|
||||
|
||||
public override bool Equals(object o) => o is GifFrameDimension format && Guid == format.Guid;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
@@ -29,5 +30,7 @@ namespace HandyControl.Data
|
||||
public bool ShowCloseButton { get; set; } = true;
|
||||
|
||||
public string Token { get; set; }
|
||||
|
||||
public FlowDirection FlowDirection { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,11 @@ namespace HandyControl.Data
|
||||
{
|
||||
public readonly struct SystemVersionInfo
|
||||
{
|
||||
public static SystemVersionInfo Windows10 => new SystemVersionInfo(10, 0, 10240);
|
||||
public static SystemVersionInfo Windows10 => new(10, 0, 10240);
|
||||
|
||||
public static SystemVersionInfo Windows10_1809 => new SystemVersionInfo(10, 0, 17763);
|
||||
public static SystemVersionInfo Windows10_1809 => new(10, 0, 17763);
|
||||
|
||||
public static SystemVersionInfo Windows10_1903 => new SystemVersionInfo(10, 0, 18362);
|
||||
public static SystemVersionInfo Windows10_1903 => new(10, 0, 18362);
|
||||
|
||||
public SystemVersionInfo(int major, int minor, int build)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{
|
||||
public static OperationResult<bool> Failed(string message = "")
|
||||
{
|
||||
return new OperationResult<bool>
|
||||
return new()
|
||||
{
|
||||
ResultType = ResultType.Failed,
|
||||
Message = message,
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
public static OperationResult<bool> Success(string message = "")
|
||||
{
|
||||
return new OperationResult<bool>
|
||||
return new()
|
||||
{
|
||||
ResultType = ResultType.Success,
|
||||
Message = message,
|
||||
|
||||
@@ -15,36 +15,36 @@ namespace HandyControl.Expression.Drawing
|
||||
|
||||
internal static Rect Bounds(this Size size)
|
||||
{
|
||||
return new Rect(0.0, 0.0, size.Width, size.Height);
|
||||
return new(0.0, 0.0, size.Width, size.Height);
|
||||
}
|
||||
|
||||
internal static Point Center(this Rect rect)
|
||||
{
|
||||
return new Point(rect.X + rect.Width / 2.0, rect.Y + rect.Height / 2.0);
|
||||
return new(rect.X + rect.Width / 2.0, rect.Y + rect.Height / 2.0);
|
||||
}
|
||||
|
||||
internal static Vector Subtract(this Point lhs, Point rhs)
|
||||
{
|
||||
return new Vector(lhs.X - rhs.X, lhs.Y - rhs.Y);
|
||||
return new(lhs.X - rhs.X, lhs.Y - rhs.Y);
|
||||
}
|
||||
|
||||
internal static Thickness Subtract(this Rect lhs, Rect rhs)
|
||||
{
|
||||
return new Thickness(rhs.Left - lhs.Left,
|
||||
return new(rhs.Left - lhs.Left,
|
||||
rhs.Top - lhs.Top, lhs.Right - rhs.Right,
|
||||
lhs.Bottom - rhs.Bottom);
|
||||
}
|
||||
|
||||
internal static Point Lerp(Point pointA, Point pointB, double alpha)
|
||||
{
|
||||
return new Point(
|
||||
return new(
|
||||
MathHelper.Lerp(pointA.X, pointB.X, alpha),
|
||||
MathHelper.Lerp(pointA.Y, pointB.Y, alpha));
|
||||
}
|
||||
|
||||
internal static Vector Lerp(Vector vectorA, Vector vectorB, double alpha)
|
||||
{
|
||||
return new Vector(MathHelper.Lerp(vectorA.X, vectorB.X, alpha),
|
||||
return new(MathHelper.Lerp(vectorA.X, vectorB.X, alpha),
|
||||
MathHelper.Lerp(vectorA.Y, vectorB.Y, alpha));
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace HandyControl.Expression.Drawing
|
||||
|
||||
internal static Point RelativeToAbsolutePoint(Rect bound, Point relative)
|
||||
{
|
||||
return new Point(bound.X + relative.X * bound.Width, bound.Y + relative.Y * bound.Height);
|
||||
return new(bound.X + relative.X * bound.Width, bound.Y + relative.Y * bound.Height);
|
||||
}
|
||||
|
||||
internal static double SquaredDistance(Point lhs, Point rhs)
|
||||
@@ -119,7 +119,7 @@ namespace HandyControl.Expression.Drawing
|
||||
|
||||
internal static Point Midpoint(Point lhs, Point rhs)
|
||||
{
|
||||
return new Point((lhs.X + rhs.X) / 2.0, (lhs.Y + rhs.Y) / 2.0);
|
||||
return new((lhs.X + rhs.X) / 2.0, (lhs.Y + rhs.Y) / 2.0);
|
||||
}
|
||||
|
||||
internal static bool HasValidArea(this Size size)
|
||||
@@ -166,12 +166,12 @@ namespace HandyControl.Expression.Drawing
|
||||
|
||||
internal static Point Plus(this Point lhs, Point rhs)
|
||||
{
|
||||
return new Point(lhs.X + rhs.X, lhs.Y + rhs.Y);
|
||||
return new(lhs.X + rhs.X, lhs.Y + rhs.Y);
|
||||
}
|
||||
|
||||
internal static Point Minus(this Point lhs, Point rhs)
|
||||
{
|
||||
return new Point(lhs.X - rhs.X, lhs.Y - rhs.Y);
|
||||
return new(lhs.X - rhs.X, lhs.Y - rhs.Y);
|
||||
}
|
||||
|
||||
internal static Vector Normal(Point lhs, Point rhs)
|
||||
|
||||
@@ -21,19 +21,13 @@ namespace HandyControl.Expression.Drawing
|
||||
arcSegment.Size.Height, arcSegment.RotationAngle, arcSegment.IsLargeArc,
|
||||
arcSegment.SweepDirection == SweepDirection.Clockwise, arcSegment.Point.X, arcSegment.Point.Y,
|
||||
out var pointArray, out var num);
|
||||
switch (num)
|
||||
return num switch
|
||||
{
|
||||
case -1:
|
||||
return null;
|
||||
|
||||
case 0:
|
||||
return CreateLineSegment(arcSegment.Point, isStroked);
|
||||
|
||||
case 1:
|
||||
return CreateBezierSegment(pointArray[0], pointArray[1], pointArray[2], isStroked);
|
||||
}
|
||||
|
||||
return CreatePolyBezierSegment(pointArray, 0, num * 3, isStroked);
|
||||
-1 => null,
|
||||
0 => CreateLineSegment(arcSegment.Point, isStroked),
|
||||
1 => CreateBezierSegment(pointArray[0], pointArray[1], pointArray[2], isStroked),
|
||||
_ => CreatePolyBezierSegment(pointArray, 0, num * 3, isStroked)
|
||||
};
|
||||
}
|
||||
|
||||
public static ArcSegment CreateArcSegment(Point point, Size size, bool isLargeArc, bool clockwise,
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace HandyControl.Expression.Media
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
private static Size GetArcSize(Rect bound)
|
||||
{
|
||||
return new Size(bound.Width / 2.0, bound.Height / 2.0);
|
||||
return new(bound.Width / 2.0, bound.Height / 2.0);
|
||||
}
|
||||
|
||||
private static void IncreaseDuplicatedIndex(IList<double> values, ref int index)
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace HandyControl.Expression.Shapes
|
||||
|
||||
protected abstract IGeometrySource CreateGeometrySource();
|
||||
|
||||
protected override Size MeasureOverride(Size availableSize) => new Size(base.StrokeThickness, base.StrokeThickness);
|
||||
protected override Size MeasureOverride(Size availableSize) => new(base.StrokeThickness, base.StrokeThickness);
|
||||
|
||||
private void RealizeGeometry() => RenderedGeometryChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\DataGridAttach.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\DropDownElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\EdgeElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\GridAttach.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\IconElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\IconSwitchElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\ImageAttach.cs" />
|
||||
@@ -23,6 +24,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PanelElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PasswordBoxAttach.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\RectangleAttach.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\ScrollViewerAttach.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\TextBlockAttach.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Base\AdornerElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Block\FloatingBlock.cs" />
|
||||
@@ -48,6 +50,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Watermark.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\AxleCanvas.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\FlexPanel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\ElementGroup.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\SimpleStackPanel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\UniformSpacingPanel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\PropertyGrid\Editors\ImagePropertyEditor.cs" />
|
||||
@@ -372,6 +375,8 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\ScreenHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\SecurityHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\SingleOpenHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\SystemHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\TextHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\TokenizerHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\TouchDragMoveWindowHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\ValidateHelper.cs" />
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace HandyControl.Interactivity
|
||||
new PropertyMetadata(null));
|
||||
|
||||
private static readonly Dictionary<object, Storyboard> TransitionStoryboardDictionary =
|
||||
new Dictionary<object, Storyboard>();
|
||||
new();
|
||||
|
||||
public Duration Duration
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace HandyControl.Interactivity
|
||||
|
||||
private static DateTime NextToLastPurgeTick = DateTime.MinValue;
|
||||
|
||||
internal static Dictionary<object, TagData> TagDictionary = new Dictionary<object, TagData>();
|
||||
internal static Dictionary<object, TagData> TagDictionary = new();
|
||||
|
||||
public static readonly DependencyProperty TagPathProperty = DependencyProperty.Register("TagPath",
|
||||
typeof(string), typeof(FluidMoveBehaviorBase), new PropertyMetadata(string.Empty));
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace HandyControl.Interactivity
|
||||
{
|
||||
if (parameter is DependencyObject dependencyObject)
|
||||
{
|
||||
if (Window.GetWindow(dependencyObject) is Window window)
|
||||
if (Window.GetWindow(dependencyObject) is { } window)
|
||||
{
|
||||
window.Close();
|
||||
}
|
||||
|
||||
@@ -10,176 +10,176 @@ namespace HandyControl.Interactivity
|
||||
/// <summary>
|
||||
/// 搜索
|
||||
/// </summary>
|
||||
public static RoutedCommand Search { get; } = new RoutedCommand(nameof(Search), typeof(ControlCommands));
|
||||
public static RoutedCommand Search { get; } = new(nameof(Search), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 清除
|
||||
/// </summary>
|
||||
public static RoutedCommand Clear { get; } = new RoutedCommand(nameof(Clear), typeof(ControlCommands));
|
||||
public static RoutedCommand Clear { get; } = new(nameof(Clear), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 切换
|
||||
/// </summary>
|
||||
public static RoutedCommand Switch { get; } = new RoutedCommand(nameof(Switch), typeof(ControlCommands));
|
||||
public static RoutedCommand Switch { get; } = new(nameof(Switch), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 右转
|
||||
/// </summary>
|
||||
public static RoutedCommand RotateRight { get; } = new RoutedCommand(nameof(RotateRight), typeof(ControlCommands));
|
||||
public static RoutedCommand RotateRight { get; } = new(nameof(RotateRight), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 左转
|
||||
/// </summary>
|
||||
public static RoutedCommand RotateLeft { get; } = new RoutedCommand(nameof(RotateLeft), typeof(ControlCommands));
|
||||
public static RoutedCommand RotateLeft { get; } = new(nameof(RotateLeft), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 小
|
||||
/// </summary>
|
||||
public static RoutedCommand Reduce { get; } = new RoutedCommand(nameof(Reduce), typeof(ControlCommands));
|
||||
public static RoutedCommand Reduce { get; } = new(nameof(Reduce), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 大
|
||||
/// </summary>
|
||||
public static RoutedCommand Enlarge { get; } = new RoutedCommand(nameof(Enlarge), typeof(ControlCommands));
|
||||
public static RoutedCommand Enlarge { get; } = new(nameof(Enlarge), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 还原
|
||||
/// </summary>
|
||||
public static RoutedCommand Restore { get; } = new RoutedCommand(nameof(Restore), typeof(ControlCommands));
|
||||
public static RoutedCommand Restore { get; } = new(nameof(Restore), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 打开
|
||||
/// </summary>
|
||||
public static RoutedCommand Open { get; } = new RoutedCommand(nameof(Open), typeof(ControlCommands));
|
||||
public static RoutedCommand Open { get; } = new(nameof(Open), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
public static RoutedCommand Save { get; } = new RoutedCommand(nameof(Save), typeof(ControlCommands));
|
||||
public static RoutedCommand Save { get; } = new(nameof(Save), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 选中
|
||||
/// </summary>
|
||||
public static RoutedCommand Selected { get; } = new RoutedCommand(nameof(Selected), typeof(ControlCommands));
|
||||
public static RoutedCommand Selected { get; } = new(nameof(Selected), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 关闭
|
||||
/// </summary>
|
||||
public static RoutedCommand Close { get; } = new RoutedCommand(nameof(Close), typeof(ControlCommands));
|
||||
public static RoutedCommand Close { get; } = new(nameof(Close), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 取消
|
||||
/// </summary>
|
||||
public static RoutedCommand Cancel { get; } = new RoutedCommand(nameof(Cancel), typeof(ControlCommands));
|
||||
public static RoutedCommand Cancel { get; } = new(nameof(Cancel), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 确定
|
||||
/// </summary>
|
||||
public static RoutedCommand Confirm { get; } = new RoutedCommand(nameof(Confirm), typeof(ControlCommands));
|
||||
public static RoutedCommand Confirm { get; } = new(nameof(Confirm), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 是
|
||||
/// </summary>
|
||||
public static RoutedCommand Yes { get; } = new RoutedCommand(nameof(Yes), typeof(ControlCommands));
|
||||
public static RoutedCommand Yes { get; } = new(nameof(Yes), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 否
|
||||
/// </summary>
|
||||
public static RoutedCommand No { get; } = new RoutedCommand(nameof(No), typeof(ControlCommands));
|
||||
public static RoutedCommand No { get; } = new(nameof(No), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 关闭所有
|
||||
/// </summary>
|
||||
public static RoutedCommand CloseAll { get; } = new RoutedCommand(nameof(CloseAll), typeof(ControlCommands));
|
||||
public static RoutedCommand CloseAll { get; } = new(nameof(CloseAll), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 关闭其他
|
||||
/// </summary>
|
||||
public static RoutedCommand CloseOther { get; } = new RoutedCommand(nameof(CloseOther), typeof(ControlCommands));
|
||||
public static RoutedCommand CloseOther { get; } = new(nameof(CloseOther), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 上一个
|
||||
/// </summary>
|
||||
public static RoutedCommand Prev { get; } = new RoutedCommand(nameof(Prev), typeof(ControlCommands));
|
||||
public static RoutedCommand Prev { get; } = new(nameof(Prev), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 下一个
|
||||
/// </summary>
|
||||
public static RoutedCommand Next { get; } = new RoutedCommand(nameof(Next), typeof(ControlCommands));
|
||||
public static RoutedCommand Next { get; } = new(nameof(Next), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 跳转
|
||||
/// </summary>
|
||||
public static RoutedCommand Jump { get; } = new RoutedCommand(nameof(Jump), typeof(ControlCommands));
|
||||
public static RoutedCommand Jump { get; } = new(nameof(Jump), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 上午
|
||||
/// </summary>
|
||||
public static RoutedCommand Am { get; } = new RoutedCommand(nameof(Am), typeof(ControlCommands));
|
||||
public static RoutedCommand Am { get; } = new(nameof(Am), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 下午
|
||||
/// </summary>
|
||||
public static RoutedCommand Pm { get; } = new RoutedCommand(nameof(Pm), typeof(ControlCommands));
|
||||
public static RoutedCommand Pm { get; } = new(nameof(Pm), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 确认
|
||||
/// </summary>
|
||||
public static RoutedCommand Sure { get; } = new RoutedCommand(nameof(Sure), typeof(ControlCommands));
|
||||
public static RoutedCommand Sure { get; } = new(nameof(Sure), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 小时改变
|
||||
/// </summary>
|
||||
public static RoutedCommand HourChange { get; } = new RoutedCommand(nameof(HourChange), typeof(ControlCommands));
|
||||
public static RoutedCommand HourChange { get; } = new(nameof(HourChange), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 分钟改变
|
||||
/// </summary>
|
||||
public static RoutedCommand MinuteChange { get; } = new RoutedCommand(nameof(MinuteChange), typeof(ControlCommands));
|
||||
public static RoutedCommand MinuteChange { get; } = new(nameof(MinuteChange), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 秒改变
|
||||
/// </summary>
|
||||
public static RoutedCommand SecondChange { get; } = new RoutedCommand(nameof(SecondChange), typeof(ControlCommands));
|
||||
public static RoutedCommand SecondChange { get; } = new(nameof(SecondChange), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标移动
|
||||
/// </summary>
|
||||
public static RoutedCommand MouseMove { get; } = new RoutedCommand(nameof(MouseMove), typeof(ControlCommands));
|
||||
public static RoutedCommand MouseMove { get; } = new(nameof(MouseMove), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 打开链接
|
||||
/// </summary>
|
||||
public static OpenLinkCommand OpenLink { get; } = new OpenLinkCommand();
|
||||
public static OpenLinkCommand OpenLink { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 关闭程序
|
||||
/// </summary>
|
||||
public static ShutdownAppCommand ShutdownApp { get; } = new ShutdownAppCommand();
|
||||
public static ShutdownAppCommand ShutdownApp { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 前置主窗口
|
||||
/// </summary>
|
||||
public static PushMainWindow2TopCommand PushMainWindow2Top { get; } = new PushMainWindow2TopCommand();
|
||||
public static PushMainWindow2TopCommand PushMainWindow2Top { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 关闭窗口
|
||||
/// </summary>
|
||||
public static CloseWindowCommand CloseWindow { get; } = new CloseWindowCommand();
|
||||
public static CloseWindowCommand CloseWindow { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 开始截图
|
||||
/// </summary>
|
||||
public static StartScreenshotCommand StartScreenshot { get; } = new StartScreenshotCommand();
|
||||
public static StartScreenshotCommand StartScreenshot { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 按照类别排序
|
||||
/// </summary>
|
||||
public static RoutedCommand SortByCategory { get; } = new RoutedCommand(nameof(SortByCategory), typeof(ControlCommands));
|
||||
public static RoutedCommand SortByCategory { get; } = new(nameof(SortByCategory), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 按照名称排序
|
||||
/// </summary>
|
||||
public static RoutedCommand SortByName { get; } = new RoutedCommand(nameof(SortByName), typeof(ControlCommands));
|
||||
public static RoutedCommand SortByName { get; } = new(nameof(SortByName), typeof(ControlCommands));
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@ namespace HandyControl.Interactivity
|
||||
private static ResourceManager ResourceMan;
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
internal static ResourceManager ResourceManager => ResourceMan ?? (ResourceMan = new ResourceManager(nameof(ExceptionStringTable),
|
||||
typeof(ExceptionStringTable).Assembly));
|
||||
internal static ResourceManager ResourceManager => ResourceMan ??= new ResourceManager(nameof(ExceptionStringTable),
|
||||
typeof(ExceptionStringTable).Assembly);
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
internal static CultureInfo Culture { get; set; }
|
||||
|
||||
@@ -490,44 +490,26 @@ namespace HandyControl.Interactivity
|
||||
var layoutSlot = LayoutInformation.GetLayoutSlot(element);
|
||||
var x = 0.0;
|
||||
var y = 0.0;
|
||||
switch (element.HorizontalAlignment)
|
||||
x = element.HorizontalAlignment switch
|
||||
{
|
||||
case HorizontalAlignment.Left:
|
||||
x = layoutSlot.Left + margin.Left;
|
||||
break;
|
||||
|
||||
case HorizontalAlignment.Center:
|
||||
x = (layoutSlot.Left + margin.Left + layoutSlot.Right - margin.Right) / 2.0 - actualWidth / 2.0;
|
||||
break;
|
||||
|
||||
case HorizontalAlignment.Right:
|
||||
x = layoutSlot.Right - margin.Right - actualWidth;
|
||||
break;
|
||||
|
||||
case HorizontalAlignment.Stretch:
|
||||
x = Math.Max(layoutSlot.Left + margin.Left,
|
||||
(layoutSlot.Left + margin.Left + layoutSlot.Right - margin.Right) / 2.0 - actualWidth / 2.0);
|
||||
break;
|
||||
}
|
||||
switch (element.VerticalAlignment)
|
||||
HorizontalAlignment.Left => layoutSlot.Left + margin.Left,
|
||||
HorizontalAlignment.Center => (layoutSlot.Left + margin.Left + layoutSlot.Right - margin.Right) / 2.0 -
|
||||
actualWidth / 2.0,
|
||||
HorizontalAlignment.Right => layoutSlot.Right - margin.Right - actualWidth,
|
||||
HorizontalAlignment.Stretch => Math.Max(layoutSlot.Left + margin.Left,
|
||||
(layoutSlot.Left + margin.Left + layoutSlot.Right - margin.Right) / 2.0 - actualWidth / 2.0),
|
||||
_ => x
|
||||
};
|
||||
y = element.VerticalAlignment switch
|
||||
{
|
||||
case VerticalAlignment.Top:
|
||||
y = layoutSlot.Top + margin.Top;
|
||||
break;
|
||||
|
||||
case VerticalAlignment.Center:
|
||||
y = (layoutSlot.Top + margin.Top + layoutSlot.Bottom - margin.Bottom) / 2.0 - actualHeight / 2.0;
|
||||
break;
|
||||
|
||||
case VerticalAlignment.Bottom:
|
||||
y = layoutSlot.Bottom - margin.Bottom - actualHeight;
|
||||
break;
|
||||
|
||||
case VerticalAlignment.Stretch:
|
||||
y = Math.Max(layoutSlot.Top + margin.Top,
|
||||
(layoutSlot.Top + margin.Top + layoutSlot.Bottom - margin.Bottom) / 2.0 - actualHeight / 2.0);
|
||||
break;
|
||||
}
|
||||
VerticalAlignment.Top => layoutSlot.Top + margin.Top,
|
||||
VerticalAlignment.Center => (layoutSlot.Top + margin.Top + layoutSlot.Bottom - margin.Bottom) / 2.0 -
|
||||
actualHeight / 2.0,
|
||||
VerticalAlignment.Bottom => layoutSlot.Bottom - margin.Bottom - actualHeight,
|
||||
VerticalAlignment.Stretch => Math.Max(layoutSlot.Top + margin.Top,
|
||||
(layoutSlot.Top + margin.Top + layoutSlot.Bottom - margin.Bottom) / 2.0 - actualHeight / 2.0),
|
||||
_ => y
|
||||
};
|
||||
return new Rect(x, y, actualWidth, actualHeight);
|
||||
}
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace HandyControl.Media.Animation
|
||||
return AnimationHelper.ComposeGeometry(Strings, currentIterationValue);
|
||||
}
|
||||
|
||||
protected sealed override Duration GetNaturalDurationCore(Clock clock) => new Duration(LargestTimeSpanKeyTime);
|
||||
protected sealed override Duration GetNaturalDurationCore(Clock clock) => new(LargestTimeSpanKeyTime);
|
||||
|
||||
IList IKeyFrameAnimation.KeyFrames
|
||||
{
|
||||
|
||||
@@ -234,4 +234,7 @@
|
||||
<data name="All" xml:space="preserve">
|
||||
<value>Wszystkie</value>
|
||||
</data>
|
||||
<data name="NoData" xml:space="preserve">
|
||||
<value>No Data</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -8,7 +8,7 @@ namespace HandyControl.Properties.Langs
|
||||
{
|
||||
public class LangProvider : INotifyPropertyChanged
|
||||
{
|
||||
internal static LangProvider Instance => ResourceHelper.GetResource<LangProvider>("Langs");
|
||||
internal static LangProvider Instance { get; } = ResourceHelper.GetResourceInternal<LangProvider>("Langs");
|
||||
|
||||
private static string CultureInfoStr;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace HandyControl.Properties.Langs
|
||||
{
|
||||
public class LangProvider : INotifyPropertyChanged
|
||||
{
|
||||
internal static LangProvider Instance => ResourceHelper.GetResource<LangProvider>("Langs");
|
||||
internal static LangProvider Instance { get; } = ResourceHelper.GetResourceInternal<LangProvider>("Langs");
|
||||
|
||||
private static string CultureInfoStr;
|
||||
|
||||
@@ -81,4 +81,4 @@ namespace HandyControl.Properties.Langs
|
||||
|
||||
<#}#>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace HandyControl.Themes
|
||||
{
|
||||
public class SharedResourceDictionary : ResourceDictionary
|
||||
{
|
||||
public static Dictionary<Uri, ResourceDictionary> SharedDictionaries = new Dictionary<Uri, ResourceDictionary>();
|
||||
public static Dictionary<Uri, ResourceDictionary> SharedDictionaries = new();
|
||||
|
||||
private Uri _sourceUri;
|
||||
|
||||
|
||||
@@ -148,10 +148,10 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.ColumnSpan="2" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel Grid.ColumnSpan="2" LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Popup Grid.Row="1" Grid.Column="0" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border BorderThickness="0,1,0,0" Effect="{StaticResource EffectShadow2}" Margin="8,0,8,8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" MinWidth="{Binding ActualWidth, ElementName=toggleButton}" MaxHeight="{TemplateBinding MaxDropDownHeight}" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
|
||||
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
|
||||
@@ -218,10 +218,10 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Popup Grid.Column="1" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border BorderThickness="0,1,0,0" Effect="{StaticResource EffectShadow2}" Margin="8,0,8,8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" MinWidth="{Binding ActualWidth, ElementName=toggleButton}" MaxHeight="{TemplateBinding MaxDropDownHeight}" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
|
||||
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
|
||||
@@ -374,10 +374,10 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.ColumnSpan="2" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel Grid.ColumnSpan="2" LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Popup Grid.Column="0" Grid.Row="1" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border BorderThickness="0,1,0,0" Effect="{StaticResource EffectShadow2}" Margin="8,0,8,8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" MinWidth="{Binding ActualWidth, ElementName=toggleButton}" MaxHeight="{TemplateBinding MaxDropDownHeight}" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
|
||||
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
|
||||
@@ -444,10 +444,10 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Popup Grid.Column="1" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border BorderThickness="0,1,0,0" Effect="{StaticResource EffectShadow2}" Margin="8,0,8,8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" MinWidth="{Binding ActualWidth, ElementName=toggleButton}" MaxHeight="{TemplateBinding MaxDropDownHeight}" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
|
||||
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
|
||||
@@ -623,10 +623,10 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.ColumnSpan="2" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel Grid.ColumnSpan="2" LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Popup Grid.Row="1" Grid.Column="0" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border BorderThickness="0,1,0,0" Effect="{StaticResource EffectShadow2}" Margin="8,0,8,8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" MinWidth="{Binding ActualWidth, ElementName=toggleButton}" MaxHeight="{TemplateBinding MaxDropDownHeight}" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
|
||||
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
|
||||
@@ -733,10 +733,10 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Popup Grid.Column="1" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border BorderThickness="0,1,0,0" Effect="{StaticResource EffectShadow2}" Margin="8,0,8,8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" MinWidth="{Binding ActualWidth, ElementName=toggleButton}" MaxHeight="{TemplateBinding MaxDropDownHeight}" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
|
||||
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
|
||||
@@ -846,10 +846,10 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.ColumnSpan="2" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel Grid.ColumnSpan="2" LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Popup Grid.Column="0" Grid.Row="1" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border BorderThickness="0,1,0,0" Effect="{StaticResource EffectShadow2}" Margin="8,0,8,8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" MinWidth="{Binding ActualWidth, ElementName=toggleButton}" MaxHeight="{TemplateBinding MaxDropDownHeight}" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
|
||||
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
|
||||
@@ -976,10 +976,10 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.ColumnSpan="2" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel Grid.ColumnSpan="2" LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Popup Grid.Column="0" Grid.Row="1" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border BorderThickness="0,1,0,0" Effect="{StaticResource EffectShadow2}" Margin="8,0,8,8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" MinWidth="{Binding ActualWidth, ElementName=toggleButton}" MaxHeight="{TemplateBinding MaxDropDownHeight}" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
|
||||
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
|
||||
@@ -1123,10 +1123,10 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Popup Grid.Column="1" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border BorderThickness="0,1,0,0" Effect="{StaticResource EffectShadow2}" Margin="8,0,8,8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" MinWidth="{Binding ActualWidth, ElementName=toggleButton}" MaxHeight="{TemplateBinding MaxDropDownHeight}" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
|
||||
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
|
||||
@@ -1250,10 +1250,10 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Popup Grid.Column="1" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border BorderThickness="0,1,0,0" Effect="{StaticResource EffectShadow2}" Margin="8,0,8,8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" MinWidth="{Binding ActualWidth, ElementName=toggleButton}" MaxHeight="{TemplateBinding MaxDropDownHeight}" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
|
||||
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
|
||||
|
||||
@@ -90,10 +90,10 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border Grid.Row="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -139,10 +139,10 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border Grid.Column="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -210,10 +210,10 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<TextBlock FontSize="12" Grid.Row="1" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}"/>
|
||||
<Border Grid.Row="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
@@ -286,10 +286,10 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Column="1"/>
|
||||
<Border Grid.Column="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border Grid.Row="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -120,10 +120,10 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border Grid.Column="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -191,10 +191,10 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<TextBlock FontSize="12" Grid.Row="1" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}"/>
|
||||
<Border Grid.Row="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
@@ -267,10 +267,10 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Column="1"/>
|
||||
<Border Grid.Column="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
|
||||
@@ -96,7 +96,6 @@
|
||||
</ControlTemplate>
|
||||
|
||||
<Style x:Key="GroupBoxOriginalBaseStyle" BasedOn="{StaticResource GroupBoxBaseStyle}" TargetType="GroupBox">
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="hc:BorderElement.CornerRadius" Value="0"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Top"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
|
||||
@@ -202,7 +202,6 @@
|
||||
<Setter Property="FontWeight" Value="Normal"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource MenuItemBaseStyle}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Menu">
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Foreground="{TemplateBinding Foreground}" Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel Grid.ColumnSpan="2" LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border Grid.Row="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -110,10 +110,10 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
||||
<TextBlock Foreground="{TemplateBinding Foreground}" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border Grid.Column="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -172,10 +172,10 @@
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="PART_ErrorTip" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Row="1"/>
|
||||
<StackPanel Grid.Row="0" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Foreground="{TemplateBinding Foreground}" Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel Grid.ColumnSpan="2" LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border Grid.Row="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -239,10 +239,10 @@
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="PART_ErrorTip" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Column="1"/>
|
||||
<StackPanel Grid.Column="0" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,8">
|
||||
<TextBlock Foreground="{TemplateBinding Foreground}" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel Grid.Column="0" LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border Grid.Column="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
@@ -57,10 +57,10 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border x:Name="border" Grid.Row="1" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"/>
|
||||
<TextBlock x:Name="placeholder" Padding="1" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Grid.Row="1" HorizontalAlignment="Stretch" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ScrollViewer Margin="-1,1" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Row="1" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
||||
@@ -89,10 +89,10 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border x:Name="border" Grid.Column="1" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"/>
|
||||
<TextBlock Padding="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="placeholder" Visibility="Collapsed" Grid.Column="1" HorizontalAlignment="Stretch" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ScrollViewer Margin="-1,1" Padding="{TemplateBinding Padding}" Grid.Column="1" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
||||
@@ -178,10 +178,10 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.ColumnSpan="2" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel Grid.ColumnSpan="3" LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<TextBlock FontSize="12" Grid.Column="0" Grid.ColumnSpan="3" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Row="1"/>
|
||||
<Border Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"/>
|
||||
<PasswordBox Margin="-1,1,0,1" Visibility="{Binding ShowPassword,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityReConverter}}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="1" x:Name="PART_PasswordBox" PasswordChar="{TemplateBinding PasswordChar}" Style="{StaticResource PasswordBoxPlusInternalStyle}"/>
|
||||
@@ -237,10 +237,10 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="0,7,6,7">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<TextBlock FontSize="12" Grid.ColumnSpan="3" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Column="1"/>
|
||||
<Border Grid.Column="1" Grid.ColumnSpan="3" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"/>
|
||||
<PasswordBox Margin="-1,1,0,1" Visibility="{Binding ShowPassword,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityReConverter}}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" Foreground="{TemplateBinding Foreground}" Grid.Column="1" x:Name="PART_PasswordBox" PasswordChar="{TemplateBinding PasswordChar}" Style="{StaticResource PasswordBoxPlusInternalStyle}"/>
|
||||
@@ -308,4 +308,4 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary>
|
||||
@@ -38,7 +38,6 @@
|
||||
|
||||
<Style x:Key="PropertyItemToolTipBaseStyle" BasedOn="{StaticResource {x:Type ToolTip}}" TargetType="ToolTip">
|
||||
<Setter Property="Padding" Value="10"/>
|
||||
<Setter Property="hc:BorderElement.CornerRadius" Value="2"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToolTip">
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
</Storyboard>
|
||||
</ControlTemplate.Resources>
|
||||
<Border Height="{TemplateBinding Height}" Background="Transparent">
|
||||
<Rectangle x:Name="rectangle" RadiusX="4" RadiusY="4" VerticalAlignment="Bottom" Height="2" SnapsToDevicePixels="True" Width="{TemplateBinding Width}" Fill="{TemplateBinding Background}">
|
||||
<Rectangle x:Name="rectangle" RadiusX="1" RadiusY="1" VerticalAlignment="Bottom" Height="2" SnapsToDevicePixels="True" Width="{TemplateBinding Width}" Fill="{TemplateBinding Background}">
|
||||
<Rectangle.RenderTransform>
|
||||
<TransformGroup>
|
||||
<TranslateTransform Y="-2"/>
|
||||
@@ -205,6 +205,23 @@
|
||||
</Style>
|
||||
|
||||
<ControlTemplate x:Key="ScrollViewerNativeBaseControlTemplate" TargetType="ScrollViewer">
|
||||
<Grid x:Name="Grid" Background="{TemplateBinding Background}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" Grid.RowSpan="2" Grid.ColumnSpan="2" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/>
|
||||
<ScrollBar x:Name="PART_VerticalScrollBar" Style="{StaticResource ScrollBarBaseStyle}" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
|
||||
<ScrollBar x:Name="PART_HorizontalScrollBar" Style="{StaticResource ScrollBarBaseStyle}" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
|
||||
|
||||
<ControlTemplate x:Key="ScrollViewerNativeAutoHideBaseControlTemplate" TargetType="ScrollViewer">
|
||||
<ControlTemplate.Resources>
|
||||
<Storyboard x:Key="Storyboard1">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_VerticalScrollBar">
|
||||
@@ -251,10 +268,31 @@
|
||||
<Style x:Key="ScrollViewerNativeBaseStyle" TargetType="ScrollViewer">
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="Template" Value="{StaticResource ScrollViewerNativeBaseControlTemplate}"/>
|
||||
<Setter Property="Template" Value="{StaticResource ScrollViewerNativeAutoHideBaseControlTemplate}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="hc:ScrollViewerAttach.AutoHide" Value="False">
|
||||
<Setter Property="Template" Value="{StaticResource ScrollViewerNativeBaseControlTemplate}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<ControlTemplate x:Key="ScrollViewerBaseControlTemplate" TargetType="hc:ScrollViewer">
|
||||
<Grid x:Name="Grid" Background="{TemplateBinding Background}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" Grid.RowSpan="2" Grid.ColumnSpan="2" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/>
|
||||
<ScrollBar x:Name="PART_VerticalScrollBar" Style="{StaticResource ScrollBarBaseStyle}" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
|
||||
<ScrollBar x:Name="PART_HorizontalScrollBar" Style="{StaticResource ScrollBarBaseStyle}" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="ScrollViewerAutoHideBaseControlTemplate" TargetType="hc:ScrollViewer">
|
||||
<ControlTemplate.Resources>
|
||||
<Storyboard x:Key="Storyboard1">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_VerticalScrollBar">
|
||||
@@ -301,7 +339,12 @@
|
||||
<Style x:Key="ScrollViewerBaseStyle" TargetType="hc:ScrollViewer">
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="Template" Value="{StaticResource ScrollViewerBaseControlTemplate}"/>
|
||||
<Setter Property="Template" Value="{StaticResource ScrollViewerAutoHideBaseControlTemplate}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="hc:ScrollViewerAttach.AutoHide" Value="False">
|
||||
<Setter Property="Template" Value="{StaticResource ScrollViewerBaseControlTemplate}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -45,10 +45,10 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border Grid.Row="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -80,10 +80,10 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border Grid.Column="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -137,10 +137,10 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<TextBlock Grid.Row="1" FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}"/>
|
||||
<Border Grid.Row="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid>
|
||||
@@ -199,10 +199,10 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Column="1"/>
|
||||
<Border Grid.Column="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid>
|
||||
@@ -257,4 +257,4 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary>
|
||||
@@ -105,7 +105,7 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
@@ -217,7 +217,7 @@
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Column="1"/>
|
||||
<DockPanel LastChildFill="True" Grid.Column="0" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<DockPanel LastChildFill="True" Grid.Column="0" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
@@ -272,4 +272,4 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary>
|
||||
@@ -71,10 +71,10 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border Grid.Row="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -120,10 +120,10 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<Border Grid.Column="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -191,10 +191,10 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Margin="1,0,1,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<TextBlock Grid.Row="1" FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}"/>
|
||||
<Border Grid.Row="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
@@ -267,10 +267,10 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Column="1"/>
|
||||
<Border Grid.Column="1" x:Name="templateRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<Grid x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
<Setter Property="hc:TitleElement.Background" Value="{DynamicResource TitleBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Margin" Value="8,0,8,8"/>
|
||||
<Setter Property="ShowConfirmButton" Value="True"/>
|
||||
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter}, ConverterParameter='1,1,0,0'}" Grid.ColumnSpan="3" Background="{Binding Path=(hc:TitleElement.Background),RelativeSource={RelativeSource TemplatedParent}}" Name="PART_BorderTitle">
|
||||
<TextBlock x:Name="PART_TimeStr" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" Foreground="{DynamicResource TextIconBrush}"/>
|
||||
</Border>
|
||||
<Canvas Grid.Row="1" Grid.ColumnSpan="3" Margin="0,16,0,0" VerticalAlignment="Top" Name="PART_Canvas" Width="178" Height="178">
|
||||
<Canvas Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Margin="0,16,0,0" VerticalAlignment="Top" Name="PART_Canvas" Width="178" Height="178">
|
||||
<Border Background="{DynamicResource SecondaryRegionBrush}" Width="178" Height="178" CornerRadius="89"/>
|
||||
<hc:CirclePanel Diameter="130" x:Name="PART_PanelNum" KeepVertical="True" Margin="24,24,0,0" OffsetAngle="-60"/>
|
||||
<Border Focusable="False" Name="PART_BorderClock" Background="{DynamicResource PrimaryBrush}" RenderTransformOrigin="0.5,1" Height="63" Width="2" Canvas.Left="88" Canvas.Top="26"/>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="MinHeight" Value="60"/>
|
||||
<Setter Property="Width" Value="320"/>
|
||||
<Setter Property="Margin" Value="10,0,0,10"/>
|
||||
<Setter Property="Margin" Value="10,10,10,0"/>
|
||||
<Setter Property="MaxWidth" Value="320"/>
|
||||
<Setter Property="hc:BorderElement.CornerRadius" Value="8"/>
|
||||
<Setter Property="Background" Value="{DynamicResource ThirdlyRegionBrush}"/>
|
||||
@@ -49,13 +49,13 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.ColumnSpan="3" Grid.RowSpan="2" Effect="{StaticResource EffectShadow2}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Path Grid.Row="0" Grid.Column="0" VerticalAlignment="Top" Margin="0,15,0,0" Width="30" Height="30" Data="{TemplateBinding Icon}" Stretch="Uniform" Fill="{TemplateBinding IconBrush}"/>
|
||||
<Path FlowDirection="LeftToRight" Grid.Row="0" Grid.Column="0" VerticalAlignment="Top" Margin="0,15,0,0" Width="30" Height="30" Data="{TemplateBinding Icon}" Stretch="Uniform" Fill="{TemplateBinding IconBrush}"/>
|
||||
<StackPanel VerticalAlignment="Center" Grid.Row="0" Grid.Column="1" Margin="0,10,10,10">
|
||||
<TextBlock Text="{TemplateBinding Message}" Style="{StaticResource TextBlockDefault}" HorizontalAlignment="Left" TextWrapping="Wrap"/>
|
||||
<TextBlock Visibility="{Binding ShowDateTime,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" Text="{Binding Time,RelativeSource={RelativeSource AncestorType=hc:Growl},StringFormat=yyyy/MM/dd HH:mm:ss}" Style="{StaticResource TextBlockDefault}" Foreground="{DynamicResource SecondaryTextBrush}" HorizontalAlignment="Left" Margin="0,4,0,0"/>
|
||||
</StackPanel>
|
||||
<Button Grid.Row="0" Visibility="Collapsed" Margin="11,0" Name="PART_ButtonClose" Command="interactivity:ControlCommands.Close" Grid.Column="2" Background="Transparent" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="18" Height="18">
|
||||
<Path Data="{StaticResource ErrorGeometry}" Stretch="Uniform" Fill="{DynamicResource SecondaryTextBrush}"/>
|
||||
<Path FlowDirection="LeftToRight" Data="{StaticResource ErrorGeometry}" Stretch="Uniform" Fill="{DynamicResource SecondaryTextBrush}"/>
|
||||
</Button>
|
||||
<UniformGrid Columns="2" Name="PART_PanelMore" IsEnabled="False" Visibility="Collapsed" Grid.Row="1" Grid.ColumnSpan="3" Height="28" Grid.Column="0">
|
||||
<Button Command="interactivity:ControlCommands.Cancel" Style="{StaticResource ButtonCustom}" HorizontalAlignment="Stretch" Background="Transparent">
|
||||
@@ -71,4 +71,4 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary>
|
||||
Loaded 100 of 173 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user