Automated dotnet-format update
This commit is contained in:
1 parent
ad4c2f68aa
commit
2af18c2d38
403 files changed
+1569
-1567
No files matched your search
@@ -10,13 +10,13 @@ namespace HandyControl.Controls
|
||||
|
||||
public static void SetMouseHoverBackground(DependencyObject element, Brush value) => element.SetValue(MouseHoverBackgroundProperty, value);
|
||||
|
||||
public static Brush GetMouseHoverBackground(DependencyObject element) => (Brush)element.GetValue(MouseHoverBackgroundProperty);
|
||||
public static Brush GetMouseHoverBackground(DependencyObject element) => (Brush) element.GetValue(MouseHoverBackgroundProperty);
|
||||
|
||||
public static readonly DependencyProperty MouseDownBackgroundProperty = DependencyProperty.RegisterAttached(
|
||||
"MouseDownBackground", typeof(Brush), typeof(BackgroundSwitchElement), new FrameworkPropertyMetadata(Brushes.Transparent, FrameworkPropertyMetadataOptions.Inherits));
|
||||
|
||||
public static void SetMouseDownBackground(DependencyObject element, Brush value) => element.SetValue(MouseDownBackgroundProperty, value);
|
||||
|
||||
public static Brush GetMouseDownBackground(DependencyObject element) => (Brush)element.GetValue(MouseDownBackgroundProperty);
|
||||
public static Brush GetMouseDownBackground(DependencyObject element) => (Brush) element.GetValue(MouseDownBackgroundProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static void SetCornerRadius(DependencyObject element, CornerRadius value) => element.SetValue(CornerRadiusProperty, value);
|
||||
|
||||
public static CornerRadius GetCornerRadius(DependencyObject element) => (CornerRadius)element.GetValue(CornerRadiusProperty);
|
||||
public static CornerRadius GetCornerRadius(DependencyObject element) => (CornerRadius) element.GetValue(CornerRadiusProperty);
|
||||
|
||||
public static readonly DependencyProperty CircularProperty = DependencyProperty.RegisterAttached(
|
||||
"Circular", typeof(bool), typeof(BorderElement), new PropertyMetadata(ValueBoxes.FalseBox, OnCircularChanged));
|
||||
@@ -22,13 +22,13 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (d is Border border)
|
||||
{
|
||||
if ((bool)e.NewValue)
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
var binding = new MultiBinding
|
||||
{
|
||||
Converter = new BorderCircularConverter()
|
||||
};
|
||||
binding.Bindings.Add(new Binding(FrameworkElement.ActualWidthProperty.Name) {Source = border});
|
||||
binding.Bindings.Add(new Binding(FrameworkElement.ActualWidthProperty.Name) { Source = border });
|
||||
binding.Bindings.Add(new Binding(FrameworkElement.ActualHeightProperty.Name) { Source = border });
|
||||
border.SetBinding(Border.CornerRadiusProperty, binding);
|
||||
}
|
||||
@@ -47,4 +47,4 @@ namespace HandyControl.Controls
|
||||
public static bool GetCircular(DependencyObject element)
|
||||
=> (bool) element.GetValue(CircularProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
@@ -14,8 +14,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnApplyDefaultStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var grid = (DataGrid)d;
|
||||
if ((bool)e.NewValue)
|
||||
var grid = (DataGrid) d;
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
if (grid.AutoGenerateColumns)
|
||||
{
|
||||
@@ -35,7 +35,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void Grid_AutoGeneratedColumns(object sender, System.EventArgs e)
|
||||
{
|
||||
var grid = (DataGrid)sender;
|
||||
var grid = (DataGrid) sender;
|
||||
UpdateTextColumnStyles(grid);
|
||||
UpdateComboBoxColumnStyles(grid);
|
||||
UpdateCheckBoxColumnStyles(grid);
|
||||
@@ -52,7 +52,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnTextColumnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var grid = (DataGrid)d;
|
||||
var grid = (DataGrid) d;
|
||||
if (e.OldValue == null && e.NewValue != null)
|
||||
{
|
||||
UpdateTextColumnStyles(grid);
|
||||
@@ -61,7 +61,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static void SetTextColumnStyle(DependencyObject element, Style value) => element.SetValue(TextColumnStyleProperty, value);
|
||||
|
||||
public static Style GetTextColumnStyle(DependencyObject element) => (Style)element.GetValue(TextColumnStyleProperty);
|
||||
public static Style GetTextColumnStyle(DependencyObject element) => (Style) element.GetValue(TextColumnStyleProperty);
|
||||
|
||||
public static readonly DependencyProperty EditingTextColumnStyleProperty = DependencyProperty.RegisterAttached(
|
||||
"EditingTextColumnStyle", typeof(Style), typeof(DataGridAttach), new PropertyMetadata(default(Style), OnTextColumnStyleChanged));
|
||||
@@ -119,7 +119,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnComboBoxColumnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var grid = (DataGrid)d;
|
||||
var grid = (DataGrid) d;
|
||||
if (e.OldValue == null && e.NewValue != null)
|
||||
{
|
||||
UpdateComboBoxColumnStyles(grid);
|
||||
@@ -186,7 +186,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnCheckBoxColumnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var grid = (DataGrid)d;
|
||||
var grid = (DataGrid) d;
|
||||
if (e.OldValue == null && e.NewValue != null)
|
||||
{
|
||||
UpdateCheckBoxColumnStyles(grid);
|
||||
@@ -195,7 +195,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static void SetCheckBoxColumnStyle(DependencyObject element, Style value) => element.SetValue(CheckBoxColumnStyleProperty, value);
|
||||
|
||||
public static Style GetCheckBoxColumnStyle(DependencyObject element) => (Style)element.GetValue(CheckBoxColumnStyleProperty);
|
||||
public static Style GetCheckBoxColumnStyle(DependencyObject element) => (Style) element.GetValue(CheckBoxColumnStyleProperty);
|
||||
|
||||
public static readonly DependencyProperty EditingCheckBoxColumnStyleProperty = DependencyProperty.RegisterAttached(
|
||||
"EditingCheckBoxColumnStyle", typeof(Style), typeof(DataGridAttach), new PropertyMetadata(default(Style), OnCheckBoxColumnStyleChanged));
|
||||
@@ -252,14 +252,14 @@ namespace HandyControl.Controls
|
||||
typeof(bool), typeof(DataGridAttach),
|
||||
new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits, OnShowRowNumberChanged));
|
||||
|
||||
public static bool GetShowRowNumber(DependencyObject target) => (bool)target.GetValue(ShowRowNumberProperty);
|
||||
public static bool GetShowRowNumber(DependencyObject target) => (bool) target.GetValue(ShowRowNumberProperty);
|
||||
|
||||
public static void SetShowRowNumber(DependencyObject target, bool value) => target.SetValue(ShowRowNumberProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
private static void OnShowRowNumberChanged(DependencyObject target, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (!(target is DataGrid dataGrid)) return;
|
||||
var show = (bool)e.NewValue;
|
||||
var show = (bool) e.NewValue;
|
||||
|
||||
if (show)
|
||||
{
|
||||
@@ -287,7 +287,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
for (var i = 0; i < itemsCount; i++)
|
||||
{
|
||||
var row = (DataGridRow)generator.ContainerFromIndex(i);
|
||||
var row = (DataGridRow) generator.ContainerFromIndex(i);
|
||||
if (row != null)
|
||||
{
|
||||
row.Header = (i + 1).ToString();
|
||||
@@ -298,7 +298,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
for (var i = 0; i < itemsCount; i++)
|
||||
{
|
||||
var row = (DataGridRow)generator.ContainerFromIndex(i);
|
||||
var row = (DataGridRow) generator.ContainerFromIndex(i);
|
||||
if (row != null)
|
||||
{
|
||||
row.Header = null;
|
||||
@@ -316,7 +316,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (d is DataGrid dataGrid)
|
||||
{
|
||||
if ((bool)e.NewValue)
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
dataGrid.PreviewMouseDown += DataGrid_PreviewMouseDown;
|
||||
}
|
||||
|
||||
@@ -44,4 +44,4 @@ namespace HandyControl.Controls
|
||||
SetShowEdgeContent(d, !(GetLeftContent(d) == null && GetTopContent(d) == null &&
|
||||
GetRightContent(d) == null && GetBottomContent(d) == null));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ namespace HandyControl.Controls
|
||||
public static void SetGeometry(DependencyObject element, Geometry value)
|
||||
=> element.SetValue(GeometryProperty, value);
|
||||
|
||||
public static Geometry GetGeometry(DependencyObject element)
|
||||
public static Geometry GetGeometry(DependencyObject element)
|
||||
=> (Geometry) element.GetValue(GeometryProperty);
|
||||
|
||||
public static readonly DependencyProperty WidthProperty = DependencyProperty.RegisterAttached(
|
||||
@@ -32,4 +32,4 @@ namespace HandyControl.Controls
|
||||
public static double GetHeight(DependencyObject element)
|
||||
=> (double) element.GetValue(HeightProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static Geometry GetGeometrySelected(DependencyObject element)
|
||||
{
|
||||
return (Geometry)element.GetValue(GeometrySelectedProperty);
|
||||
return (Geometry) element.GetValue(GeometrySelectedProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static void SetPlaceholder(DependencyObject element, string value) => element.SetValue(PlaceholderProperty, value);
|
||||
|
||||
public static string GetPlaceholder(DependencyObject element) => (string)element.GetValue(PlaceholderProperty);
|
||||
public static string GetPlaceholder(DependencyObject element) => (string) element.GetValue(PlaceholderProperty);
|
||||
|
||||
/// <summary>
|
||||
/// 是否必填
|
||||
@@ -23,7 +23,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static void SetNecessary(DependencyObject element, bool value) => element.SetValue(NecessaryProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
public static bool GetNecessary(DependencyObject element) => (bool)element.GetValue(NecessaryProperty);
|
||||
public static bool GetNecessary(DependencyObject element) => (bool) element.GetValue(NecessaryProperty);
|
||||
|
||||
/// <summary>
|
||||
/// 标记
|
||||
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static void SetSymbol(DependencyObject element, string value) => element.SetValue(SymbolProperty, value);
|
||||
|
||||
public static string GetSymbol(DependencyObject element) => (string)element.GetValue(SymbolProperty);
|
||||
public static string GetSymbol(DependencyObject element) => (string) element.GetValue(SymbolProperty);
|
||||
|
||||
/// <summary>
|
||||
/// 内容高度
|
||||
@@ -43,7 +43,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static void SetContentHeight(DependencyObject element, double value) => element.SetValue(ContentHeightProperty, value);
|
||||
|
||||
public static double GetContentHeight(DependencyObject element) => (double)element.GetValue(ContentHeightProperty);
|
||||
public static double GetContentHeight(DependencyObject element) => (double) element.GetValue(ContentHeightProperty);
|
||||
|
||||
/// <summary>
|
||||
/// 最小内容高度
|
||||
@@ -81,4 +81,4 @@ namespace HandyControl.Controls
|
||||
public static string GetRegexPattern(DependencyObject element)
|
||||
=> (string) element.GetValue(RegexPatternProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void MenuItem_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var menuItem = (FrameworkElement)sender;
|
||||
var menuItem = (FrameworkElement) sender;
|
||||
menuItem.Unloaded += MenuItem_Unloaded;
|
||||
var topLine = GetTopLine(menuItem);
|
||||
var popup = GetPopup(topLine);
|
||||
@@ -40,7 +40,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void MenuItem_Unloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var menuItem = (FrameworkElement)sender;
|
||||
var menuItem = (FrameworkElement) sender;
|
||||
menuItem.Unloaded -= MenuItem_Unloaded;
|
||||
var topLine = GetTopLine(menuItem);
|
||||
var popup = GetPopup(topLine);
|
||||
@@ -69,7 +69,7 @@ namespace HandyControl.Controls
|
||||
|
||||
if (positionLeftTop.X < 0)
|
||||
{
|
||||
|
||||
|
||||
topLine.Margin = new Thickness(positionLeftTop.X - panel.Margin.Left, 0, 0, 0);
|
||||
}
|
||||
else if (positionLeftTop.X + panel.ActualWidth > workAreaRect.Right)
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace HandyControl.Controls
|
||||
private static void OnFluidMoveBehaviorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is Panel panel)
|
||||
{
|
||||
{
|
||||
var collection = Interaction.GetBehaviors(panel);
|
||||
var oldBehavior = GetTempFluidMoveBehavior(panel);
|
||||
collection.ItemRemoved(oldBehavior);
|
||||
@@ -41,4 +41,4 @@ namespace HandyControl.Controls
|
||||
private static FluidMoveBehavior GetTempFluidMoveBehavior(DependencyObject element)
|
||||
=> (FluidMoveBehavior) element.GetValue(TempFluidMoveBehaviorProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static void SetPasswordLength(DependencyObject element, int value) => element.SetValue(PasswordLengthProperty, value);
|
||||
|
||||
public static int GetPasswordLength(DependencyObject element) => (int)element.GetValue(PasswordLengthProperty);
|
||||
public static int GetPasswordLength(DependencyObject element) => (int) element.GetValue(PasswordLengthProperty);
|
||||
|
||||
/// <summary>
|
||||
/// 是否监测
|
||||
@@ -41,7 +41,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static void SetIsMonitoring(DependencyObject element, bool value) => element.SetValue(IsMonitoringProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
public static bool GetIsMonitoring(DependencyObject element) => (bool)element.GetValue(IsMonitoringProperty);
|
||||
public static bool GetIsMonitoring(DependencyObject element) => (bool) element.GetValue(IsMonitoringProperty);
|
||||
|
||||
private static void PasswordChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
@@ -51,4 +51,4 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (d is Rectangle rectangle)
|
||||
{
|
||||
if ((bool)e.NewValue)
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
var binding = new MultiBinding
|
||||
{
|
||||
|
||||
@@ -25,4 +25,4 @@ namespace HandyControl.Controls
|
||||
|
||||
public static bool GetHideUncheckedElement(DependencyObject element) => (bool) element.GetValue(HideUncheckedElementProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (d is TextBlock ctl)
|
||||
{
|
||||
if ((bool)e.NewValue)
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
ctl.TextTrimming = TextTrimming.WordEllipsis;
|
||||
UpdateTooltip(ctl);
|
||||
@@ -50,4 +50,4 @@ namespace HandyControl.Controls
|
||||
textBlock.RenderSize.Width > width || textBlock.ActualWidth < width ? textBlock.Text : null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,4 +28,4 @@ namespace HandyControl.Controls
|
||||
public static string GetStringFormat(DependencyObject element)
|
||||
=> (string) element.GetValue(StringFormatProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static void SetTitleWidth(DependencyObject element, GridLength value) => element.SetValue(TitleWidthProperty, value);
|
||||
|
||||
public static GridLength GetTitleWidth(DependencyObject element) => (GridLength)element.GetValue(TitleWidthProperty);
|
||||
public static GridLength GetTitleWidth(DependencyObject element) => (GridLength) element.GetValue(TitleWidthProperty);
|
||||
|
||||
public static readonly DependencyProperty HorizontalAlignmentProperty = DependencyProperty.RegisterAttached(
|
||||
"HorizontalAlignment", typeof(HorizontalAlignment), typeof(TitleElement), new FrameworkPropertyMetadata(default(HorizontalAlignment), FrameworkPropertyMetadataOptions.Inherits));
|
||||
@@ -76,4 +76,4 @@ namespace HandyControl.Controls
|
||||
public static VerticalAlignment GetVerticalAlignment(DependencyObject element)
|
||||
=> (VerticalAlignment) element.GetValue(VerticalAlignmentProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,4 +50,4 @@ namespace HandyControl.Controls
|
||||
public static string GetText(DependencyObject element)
|
||||
=> (string) element.GetValue(TextProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (d is UIElement ctl)
|
||||
{
|
||||
if ((bool)e.NewValue)
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
ctl.MouseLeftButtonDown += DragElement_MouseLeftButtonDown;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (d is System.Windows.Window window)
|
||||
{
|
||||
if ((bool)e.NewValue)
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
window.PreviewKeyDown += Window_PreviewKeyDown;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ namespace HandyControl.Controls
|
||||
=> element.SetValue(ShowInTaskManagerProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
public static bool GetShowInTaskManager(DependencyObject element)
|
||||
=> (bool)element.GetValue(ShowInTaskManagerProperty);
|
||||
=> (bool) element.GetValue(ShowInTaskManagerProperty);
|
||||
|
||||
public static readonly DependencyProperty HideWhenClosingProperty = DependencyProperty.RegisterAttached(
|
||||
"HideWhenClosing", typeof(bool), typeof(WindowAttach), new PropertyMetadata(ValueBoxes.FalseBox, OnHideWhenClosingChanged));
|
||||
@@ -119,7 +119,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (d is System.Windows.Window window)
|
||||
{
|
||||
var v = (bool)e.NewValue;
|
||||
var v = (bool) e.NewValue;
|
||||
if (v)
|
||||
{
|
||||
window.Closing += Window_Closing;
|
||||
@@ -146,4 +146,4 @@ namespace HandyControl.Controls
|
||||
public static bool GetHideWhenClosing(DependencyObject element)
|
||||
=> (bool) element.GetValue(HideWhenClosingProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,9 +15,9 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnTargetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (AdornerElement)d;
|
||||
var ctl = (AdornerElement) d;
|
||||
ctl.OnTargetChanged(ctl.ElementTarget, false);
|
||||
ctl.OnTargetChanged((FrameworkElement)e.NewValue, true);
|
||||
ctl.OnTargetChanged((FrameworkElement) e.NewValue, true);
|
||||
}
|
||||
|
||||
[Bindable(true), Category("Layout")]
|
||||
@@ -34,7 +34,7 @@ namespace HandyControl.Controls
|
||||
private static void OnInstanceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (!(d is FrameworkElement target)) return;
|
||||
var element = (AdornerElement)e.NewValue;
|
||||
var element = (AdornerElement) e.NewValue;
|
||||
element.OnInstanceChanged(target);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,4 +22,4 @@ namespace HandyControl.Controls
|
||||
set => SetValue(HeaderTemplateProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,4 +13,4 @@ namespace HandyControl.Controls
|
||||
set => SetValue(HeaderProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,4 +4,4 @@
|
||||
{
|
||||
object GetGravatar(string id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,4 +8,4 @@ namespace HandyControl.Controls
|
||||
|
||||
bool IsSelected { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,4 +6,4 @@ namespace HandyControl.Controls
|
||||
{
|
||||
bool CanDispose { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,4 +38,4 @@ namespace HandyControl.Controls
|
||||
set => SetValue(ItemMarginProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsSelected
|
||||
{
|
||||
get => (bool)GetValue(IsSelectedProperty);
|
||||
get => (bool) GetValue(IsSelectedProperty);
|
||||
set => SetValue(IsSelectedProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -108,4 +108,4 @@ namespace HandyControl.Controls
|
||||
remove => RemoveHandler(DeselectedEvent, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnItemTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
private static void OnItemTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
=> (d as SimpleItemsControl)?.OnItemTemplateChanged(e);
|
||||
|
||||
protected virtual void OnItemTemplateChanged(DependencyPropertyChangedEventArgs e) => Refresh();
|
||||
@@ -164,4 +164,4 @@ namespace HandyControl.Controls
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ namespace HandyControl.Controls
|
||||
=> element.SetValue(ToYProperty, value);
|
||||
|
||||
public static double GetToY(DependencyObject element)
|
||||
=> (double)element.GetValue(ToYProperty);
|
||||
=> (double) element.GetValue(ToYProperty);
|
||||
|
||||
public static readonly DependencyProperty DurationProperty = DependencyProperty.RegisterAttached(
|
||||
"Duration", typeof(Duration), typeof(FloatingBlock), new PropertyMetadata(new Duration(TimeSpan.FromSeconds(2))));
|
||||
@@ -57,7 +57,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static double GetVerticalOffset(DependencyObject element)
|
||||
=> (double) element.GetValue(VerticalOffsetProperty);
|
||||
|
||||
|
||||
public static readonly DependencyProperty ContentTemplateProperty = DependencyProperty.RegisterAttached(
|
||||
"ContentTemplate", typeof(DataTemplate), typeof(FloatingBlock), new PropertyMetadata(default(DataTemplate), OnDataChanged));
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public DataTemplate ContentTemplate
|
||||
{
|
||||
get => (DataTemplate)GetValue(ContentTemplateProperty);
|
||||
get => (DataTemplate) GetValue(ContentTemplateProperty);
|
||||
set => SetValue(ContentTemplateProperty, value);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace HandyControl.Controls
|
||||
=> element.SetValue(ReadyToFloatProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
private static bool GetReadyToFloat(DependencyObject element)
|
||||
=> (bool)element.GetValue(ReadyToFloatProperty);
|
||||
=> (bool) element.GetValue(ReadyToFloatProperty);
|
||||
|
||||
public static readonly DependencyProperty ContentProperty = DependencyProperty.RegisterAttached(
|
||||
"Content", typeof(object), typeof(FloatingBlock), new PropertyMetadata(default, OnDataChanged));
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool Runaway
|
||||
{
|
||||
get => (bool)GetValue(RunawayProperty);
|
||||
get => (bool) GetValue(RunawayProperty);
|
||||
set => SetValue(RunawayProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool AutoRun
|
||||
{
|
||||
get => (bool)GetValue(AutoRunProperty);
|
||||
get => (bool) GetValue(AutoRunProperty);
|
||||
set => SetValue(AutoRunProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Orientation Orientation
|
||||
{
|
||||
get => (Orientation)GetValue(OrientationProperty);
|
||||
get => (Orientation) GetValue(OrientationProperty);
|
||||
set => SetValue(OrientationProperty, value);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Duration Duration
|
||||
{
|
||||
get => (Duration)GetValue(DurationProperty);
|
||||
get => (Duration) GetValue(DurationProperty);
|
||||
set => SetValue(DurationProperty, value);
|
||||
}
|
||||
|
||||
@@ -84,15 +84,15 @@ namespace HandyControl.Controls
|
||||
|
||||
public double Speed
|
||||
{
|
||||
get => (double)GetValue(SpeedProperty);
|
||||
get => (double) GetValue(SpeedProperty);
|
||||
set => SetValue(SpeedProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IsRunningProperty = DependencyProperty.Register(
|
||||
"IsRunning", typeof(bool), typeof(RunningBlock), new PropertyMetadata(ValueBoxes.TrueBox, (o, args) =>
|
||||
{
|
||||
var ctl = (RunningBlock)o;
|
||||
var v = (bool)args.NewValue;
|
||||
var ctl = (RunningBlock) o;
|
||||
var v = (bool) args.NewValue;
|
||||
if (v)
|
||||
{
|
||||
ctl._storyboard?.Resume();
|
||||
@@ -105,7 +105,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsRunning
|
||||
{
|
||||
get => (bool)GetValue(IsRunningProperty);
|
||||
get => (bool) GetValue(IsRunningProperty);
|
||||
set => SetValue(IsRunningProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool AutoReverse
|
||||
{
|
||||
get => (bool)GetValue(AutoReverseProperty);
|
||||
get => (bool) GetValue(AutoReverseProperty);
|
||||
set => SetValue(AutoReverseProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -190,4 +190,4 @@ namespace HandyControl.Controls
|
||||
_storyboard.Begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,4 +62,4 @@ namespace HandyControl.Controls
|
||||
|
||||
private static Size ConvertThickness2Size(Thickness th) => new Size(th.Left + th.Right, th.Top + th.Bottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ namespace HandyControl.Controls
|
||||
// Because Nullable<bool> unboxing is very slow (uses reflection) first we cast to bool
|
||||
var value = GetValue(IsCheckedProperty);
|
||||
// ReSharper disable once RedundantExplicitNullableCreation
|
||||
return value == null ? new bool?() : new bool?((bool)value);
|
||||
return value == null ? new bool?() : new bool?((bool) value);
|
||||
}
|
||||
set => SetValue(IsCheckedProperty, value.HasValue ? ValueBoxes.BooleanBox(value.Value) : null);
|
||||
}
|
||||
@@ -56,4 +56,4 @@ namespace HandyControl.Controls
|
||||
set => SetValue(IndeterminateContentProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Orientation Orientation
|
||||
{
|
||||
get => (Orientation)GetValue(OrientationProperty);
|
||||
get => (Orientation) GetValue(OrientationProperty);
|
||||
set => SetValue(OrientationProperty, value);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace HandyControl.Controls
|
||||
var count = Items.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var item = (ButtonBase)Items[i];
|
||||
var item = (ButtonBase) Items[i];
|
||||
item.Style = ItemContainerStyleSelector?.SelectStyle(item, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,4 +20,4 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,4 +28,4 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,4 +24,4 @@ namespace HandyControl.Controls
|
||||
set => SetValue(ProgressProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,8 +82,8 @@ namespace HandyControl.Controls
|
||||
public static readonly DependencyProperty AutoRunProperty = DependencyProperty.Register(
|
||||
"AutoRun", typeof(bool), typeof(Carousel), new PropertyMetadata(ValueBoxes.FalseBox, (o, args) =>
|
||||
{
|
||||
var ctl = (Carousel)o;
|
||||
ctl.TimerSwitch((bool)args.NewValue);
|
||||
var ctl = (Carousel) o;
|
||||
ctl.TimerSwitch((bool) args.NewValue);
|
||||
}));
|
||||
|
||||
public static readonly DependencyProperty IntervalProperty = DependencyProperty.Register(
|
||||
@@ -94,7 +94,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double ExtendWidth
|
||||
{
|
||||
get => (double)GetValue(ExtendWidthProperty);
|
||||
get => (double) GetValue(ExtendWidthProperty);
|
||||
set => SetValue(ExtendWidthProperty, value);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsCenter
|
||||
{
|
||||
get => (bool)GetValue(IsCenterProperty);
|
||||
get => (bool) GetValue(IsCenterProperty);
|
||||
set => SetValue(IsCenterProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public bool AutoRun
|
||||
{
|
||||
get => (bool)GetValue(AutoRunProperty);
|
||||
get => (bool) GetValue(AutoRunProperty);
|
||||
set => SetValue(AutoRunProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public TimeSpan Interval
|
||||
{
|
||||
get => (TimeSpan)GetValue(IntervalProperty);
|
||||
get => (TimeSpan) GetValue(IntervalProperty);
|
||||
set => SetValue(IntervalProperty, value);
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
else
|
||||
{
|
||||
var ctl = (FrameworkElement)ItemsHost.Children[PageIndex];
|
||||
var ctl = (FrameworkElement) ItemsHost.Children[PageIndex];
|
||||
var ctlWidth = ctl.DesiredSize.Width;
|
||||
ItemsHost.BeginAnimation(MarginProperty,
|
||||
AnimationHelper.CreateAnimation(
|
||||
@@ -297,7 +297,7 @@ namespace HandyControl.Controls
|
||||
if (!CheckNull()) return;
|
||||
|
||||
_selectedButton = e.OriginalSource as RadioButton;
|
||||
|
||||
|
||||
var index = _panelPage.Children.IndexOf(_selectedButton);
|
||||
if (index != -1)
|
||||
{
|
||||
@@ -453,4 +453,4 @@ namespace HandyControl.Controls
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,9 +98,9 @@ namespace HandyControl.Controls
|
||||
{
|
||||
var desk = InteropMethods.GetDesktopWindow();
|
||||
var dc = InteropMethods.GetWindowDC(desk);
|
||||
var a = (int)InteropMethods.GetPixel(dc, x, y);
|
||||
var a = (int) InteropMethods.GetPixel(dc, x, y);
|
||||
InteropMethods.ReleaseDC(desk, dc);
|
||||
return Color.FromArgb(255, (byte) ((a >> 0) & 0xff), (byte) ((a >> 8) & 0xff), (byte) ((a >> 16) & 0xff));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -219,7 +219,7 @@ namespace HandyControl.Controls
|
||||
|
||||
internal int ChannelA
|
||||
{
|
||||
get => (int)GetValue(ChannelAProperty);
|
||||
get => (int) GetValue(ChannelAProperty);
|
||||
set => SetValue(ChannelAProperty, value);
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ namespace HandyControl.Controls
|
||||
|
||||
internal int ChannelR
|
||||
{
|
||||
get => (int)GetValue(ChannelRProperty);
|
||||
get => (int) GetValue(ChannelRProperty);
|
||||
set => SetValue(ChannelRProperty, value);
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace HandyControl.Controls
|
||||
|
||||
internal int ChannelG
|
||||
{
|
||||
get => (int)GetValue(ChannelGProperty);
|
||||
get => (int) GetValue(ChannelGProperty);
|
||||
set => SetValue(ChannelGProperty, value);
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace HandyControl.Controls
|
||||
|
||||
internal int ChannelB
|
||||
{
|
||||
get => (int)GetValue(ChannelBProperty);
|
||||
get => (int) GetValue(ChannelBProperty);
|
||||
set => SetValue(ChannelBProperty, value);
|
||||
}
|
||||
|
||||
@@ -254,8 +254,8 @@ namespace HandyControl.Controls
|
||||
"SelectedBrush", typeof(SolidColorBrush), typeof(ColorPicker), new PropertyMetadata(Brushes.White,
|
||||
(o, args) =>
|
||||
{
|
||||
var ctl = (ColorPicker)o;
|
||||
var v = (SolidColorBrush)args.NewValue;
|
||||
var ctl = (ColorPicker) o;
|
||||
var v = (SolidColorBrush) args.NewValue;
|
||||
|
||||
if (ctl.IsNeedUpdateInfo)
|
||||
{
|
||||
@@ -275,7 +275,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public SolidColorBrush SelectedBrush
|
||||
{
|
||||
get => (SolidColorBrush)GetValue(SelectedBrushProperty);
|
||||
get => (SolidColorBrush) GetValue(SelectedBrushProperty);
|
||||
set => SetValue(SelectedBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ namespace HandyControl.Controls
|
||||
|
||||
internal SolidColorBrush SelectedBrushWithoutOpacity
|
||||
{
|
||||
get => (SolidColorBrush)GetValue(SelectedBrushWithoutOpacityProperty);
|
||||
get => (SolidColorBrush) GetValue(SelectedBrushWithoutOpacityProperty);
|
||||
set => SetValue(SelectedBrushWithoutOpacityProperty, value);
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ namespace HandyControl.Controls
|
||||
|
||||
internal SolidColorBrush BackColor
|
||||
{
|
||||
get => (SolidColorBrush)GetValue(BackColorProperty);
|
||||
get => (SolidColorBrush) GetValue(BackColorProperty);
|
||||
set => SetValue(BackColorProperty, value);
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace HandyControl.Controls
|
||||
|
||||
internal List<bool> ShowList
|
||||
{
|
||||
get => (List<bool>)GetValue(ShowListProperty);
|
||||
get => (List<bool>) GetValue(ShowListProperty);
|
||||
set => SetValue(ShowListProperty, value);
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ namespace HandyControl.Controls
|
||||
private Button CreateColorButton(string colorStr)
|
||||
{
|
||||
var color = ColorConverter.ConvertFromString(colorStr) ?? default(Color);
|
||||
var brush = new SolidColorBrush((Color)color);
|
||||
var brush = new SolidColorBrush((Color) color);
|
||||
|
||||
var button = new Button
|
||||
{
|
||||
@@ -527,7 +527,7 @@ namespace HandyControl.Controls
|
||||
var common = list[commonIndex];
|
||||
list[maxIndex] = 255;
|
||||
list[minIndex] = 0;
|
||||
common = (byte)(255 * (min - common) / (double)(min - max));
|
||||
common = (byte) (255 * (min - common) / (double) (min - max));
|
||||
list[commonIndex] = common;
|
||||
BackColor = new SolidColorBrush(Color.FromRgb(list[0], list[1], list[2]));
|
||||
|
||||
@@ -575,7 +575,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
var matrix = _borderPicker.RenderTransform.Value;
|
||||
var x = max == 0 ? 0 : (1 - min / (double)max) * ColorPanelWidth;
|
||||
var x = max == 0 ? 0 : (1 - min / (double) max) * ColorPanelWidth;
|
||||
var y = (1 - max / 255.0) * ColorPanelHeight;
|
||||
if (_isNeedUpdatePicker)
|
||||
{
|
||||
@@ -586,7 +586,7 @@ namespace HandyControl.Controls
|
||||
private void SliderColor_OnValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
if (!_appliedTemplate || !IsNeedUpdateInfo) return;
|
||||
var index = Math.Min(5, (int)Math.Floor(e.NewValue));
|
||||
var index = Math.Min(5, (int) Math.Floor(e.NewValue));
|
||||
var sub = e.NewValue - index;
|
||||
var range = _colorRangeList[index];
|
||||
|
||||
@@ -602,7 +602,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (!_appliedTemplate || !IsNeedUpdateInfo) return;
|
||||
var color = SelectedBrush.Color;
|
||||
SelectedBrush = new SolidColorBrush(Color.FromArgb((byte)_sliderOpacity.Value, color.R, color.G, color.B));
|
||||
SelectedBrush = new SolidColorBrush(Color.FromArgb((byte) _sliderOpacity.Value, color.R, color.G, color.B));
|
||||
}
|
||||
|
||||
private void MouseDragElementBehavior_OnDragging(object sender, MouseEventArgs e)
|
||||
@@ -646,15 +646,15 @@ namespace HandyControl.Controls
|
||||
var scaleX = p.X / ColorPanelWidth;
|
||||
var scaleY = 1 - p.Y / ColorPanelHeight;
|
||||
|
||||
var colorYLeft = Color.FromRgb((byte)(255 * scaleY), (byte)(255 * scaleY), (byte)(255 * scaleY));
|
||||
var colorYRight = Color.FromRgb((byte)(BackColor.Color.R * scaleY), (byte)(BackColor.Color.G * scaleY), (byte)(BackColor.Color.B * scaleY));
|
||||
var colorYLeft = Color.FromRgb((byte) (255 * scaleY), (byte) (255 * scaleY), (byte) (255 * scaleY));
|
||||
var colorYRight = Color.FromRgb((byte) (BackColor.Color.R * scaleY), (byte) (BackColor.Color.G * scaleY), (byte) (BackColor.Color.B * scaleY));
|
||||
|
||||
var subR = colorYLeft.R - colorYRight.R;
|
||||
var subG = colorYLeft.G - colorYRight.G;
|
||||
var subB = colorYLeft.B - colorYRight.B;
|
||||
|
||||
var color = Color.FromArgb((byte)_sliderOpacity.Value, (byte)(colorYLeft.R - subR * scaleX),
|
||||
(byte)(colorYLeft.G - subG * scaleX), (byte)(colorYLeft.B - subB * scaleX));
|
||||
var color = Color.FromArgb((byte) _sliderOpacity.Value, (byte) (colorYLeft.R - subR * scaleX),
|
||||
(byte) (colorYLeft.G - subG * scaleX), (byte) (colorYLeft.B - subB * scaleX));
|
||||
SelectedBrush = new SolidColorBrush(color);
|
||||
}
|
||||
|
||||
@@ -675,17 +675,17 @@ namespace HandyControl.Controls
|
||||
{
|
||||
case "R":
|
||||
{
|
||||
SelectedBrush = new SolidColorBrush(Color.FromArgb(color.A, (byte)e.Info, color.G, color.B));
|
||||
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));
|
||||
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));
|
||||
SelectedBrush = new SolidColorBrush(Color.FromArgb(color.A, color.R, color.G, (byte) e.Info));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -731,6 +731,6 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
public bool CanDispose { get; } = true;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,8 +40,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static object CoercePageIndex(DependencyObject d, object baseValue)
|
||||
{
|
||||
var ctl = (CoverFlow)d;
|
||||
var v = (int)baseValue;
|
||||
var ctl = (CoverFlow) d;
|
||||
var v = (int) baseValue;
|
||||
|
||||
if (v < 0)
|
||||
{
|
||||
@@ -56,8 +56,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnPageIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (CoverFlow)d;
|
||||
ctl.UpdateIndex((int)e.NewValue);
|
||||
var ctl = (CoverFlow) d;
|
||||
ctl.UpdateIndex((int) e.NewValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -113,7 +113,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public int PageIndex
|
||||
{
|
||||
get => (int)GetValue(PageIndexProperty);
|
||||
get => (int) GetValue(PageIndexProperty);
|
||||
internal set => SetValue(PageIndexProperty, value);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public bool Loop
|
||||
{
|
||||
get => (bool)GetValue(LoopProperty);
|
||||
get => (bool) GetValue(LoopProperty);
|
||||
set => SetValue(LoopProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private void Viewport3D_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
var result = (RayMeshGeometry3DHitTestResult)VisualTreeHelper.HitTest(_viewport3D, e.GetPosition(_viewport3D));
|
||||
var result = (RayMeshGeometry3DHitTestResult) VisualTreeHelper.HitTest(_viewport3D, e.GetPosition(_viewport3D));
|
||||
if (result != null)
|
||||
{
|
||||
foreach (var item in _itemShowDic.Values)
|
||||
@@ -301,4 +301,4 @@ namespace HandyControl.Controls
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,4 +154,4 @@ namespace HandyControl.Controls
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Style CoverViewContentStyle
|
||||
{
|
||||
get => (Style)GetValue(CoverViewContentStyleProperty);
|
||||
get => (Style) GetValue(CoverViewContentStyleProperty);
|
||||
set => SetValue(CoverViewContentStyleProperty, value);
|
||||
}
|
||||
|
||||
@@ -120,13 +120,13 @@ namespace HandyControl.Controls
|
||||
|
||||
private static bool IsGroupsValid(object value)
|
||||
{
|
||||
var v = (int)value;
|
||||
var v = (int) value;
|
||||
return v >= 1;
|
||||
}
|
||||
|
||||
public int Groups
|
||||
{
|
||||
get => (int)GetValue(GroupsProperty);
|
||||
get => (int) GetValue(GroupsProperty);
|
||||
set => SetValue(GroupsProperty, value);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double ItemContentHeight
|
||||
{
|
||||
get => (double)GetValue(ItemContentHeightProperty);
|
||||
get => (double) GetValue(ItemContentHeightProperty);
|
||||
set => SetValue(ItemContentHeightProperty, value);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool ItemContentHeightFixed
|
||||
{
|
||||
get => (bool)GetValue(ItemContentHeightFixedProperty);
|
||||
get => (bool) GetValue(ItemContentHeightFixedProperty);
|
||||
set => SetValue(ItemContentHeightFixedProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
base.OnRenderSizeChanged(sizeInfo);
|
||||
|
||||
Groups = (int)(sizeInfo.NewSize.Width / (ItemWidth + ItemMargin.Left + ItemMargin.Right));
|
||||
Groups = (int) (sizeInfo.NewSize.Width / (ItemWidth + ItemMargin.Left + ItemMargin.Right));
|
||||
}
|
||||
|
||||
protected override void Refresh()
|
||||
@@ -415,4 +415,4 @@ namespace HandyControl.Controls
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ namespace HandyControl.Controls
|
||||
|
||||
internal double ManualHeight
|
||||
{
|
||||
get => (double)GetValue(ManualHeightProperty);
|
||||
get => (double) GetValue(ManualHeightProperty);
|
||||
set => SetValue(ManualHeightProperty, value);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double ContentHeight
|
||||
{
|
||||
get => (double)GetValue(ContentHeightProperty);
|
||||
get => (double) GetValue(ContentHeightProperty);
|
||||
set => SetValue(ContentHeightProperty, value);
|
||||
}
|
||||
|
||||
@@ -119,4 +119,4 @@ namespace HandyControl.Controls
|
||||
_content.BeginAnimation(HeightProperty, animation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class CoverViewItem : HeaderedSelectableItem
|
||||
{
|
||||
{
|
||||
internal int Index { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsClosed
|
||||
{
|
||||
get => (bool)GetValue(IsClosedProperty);
|
||||
get => (bool) GetValue(IsClosedProperty);
|
||||
internal set => SetValue(IsClosedProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace HandyControl.Controls
|
||||
=> element.SetValue(TokenProperty, value);
|
||||
|
||||
public static string GetToken(DependencyObject element)
|
||||
=> (string)element.GetValue(TokenProperty);
|
||||
=> (string) element.GetValue(TokenProperty);
|
||||
|
||||
public Dialog()
|
||||
{
|
||||
@@ -116,8 +116,8 @@ namespace HandyControl.Controls
|
||||
else
|
||||
{
|
||||
ContainerDic.TryGetValue(token, out element);
|
||||
decorator = element is System.Windows.Window ?
|
||||
VisualHelper.GetChild<AdornerDecorator>(element) :
|
||||
decorator = element is System.Windows.Window ?
|
||||
VisualHelper.GetChild<AdornerDecorator>(element) :
|
||||
VisualHelper.GetChild<DialogContainer>(element);
|
||||
}
|
||||
|
||||
@@ -173,4 +173,4 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,6 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public class DialogContainer : AdornerDecorator
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ namespace HandyControl.Controls
|
||||
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)
|
||||
if ((bool) args.NewValue && o is Panel panel)
|
||||
{
|
||||
SetGrowlPanel(panel);
|
||||
}
|
||||
@@ -207,57 +207,57 @@ namespace HandyControl.Controls
|
||||
=> element.SetValue(TokenProperty, value);
|
||||
|
||||
public static string GetToken(DependencyObject element)
|
||||
=> (string)element.GetValue(TokenProperty);
|
||||
=> (string) element.GetValue(TokenProperty);
|
||||
|
||||
public static void SetGrowlParent(DependencyObject element, bool value) => element.SetValue(GrowlParentProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
public static bool GetGrowlParent(DependencyObject element) => (bool)element.GetValue(GrowlParentProperty);
|
||||
public static bool GetGrowlParent(DependencyObject element) => (bool) element.GetValue(GrowlParentProperty);
|
||||
|
||||
public InfoType Type
|
||||
{
|
||||
get => (InfoType)GetValue(TypeProperty);
|
||||
get => (InfoType) GetValue(TypeProperty);
|
||||
set => SetValue(TypeProperty, value);
|
||||
}
|
||||
|
||||
internal string CancelStr
|
||||
{
|
||||
get => (string)GetValue(CancelStrProperty);
|
||||
get => (string) GetValue(CancelStrProperty);
|
||||
set => SetValue(CancelStrProperty, value);
|
||||
}
|
||||
|
||||
internal string ConfirmStr
|
||||
{
|
||||
get => (string)GetValue(ConfirmStrProperty);
|
||||
get => (string) GetValue(ConfirmStrProperty);
|
||||
set => SetValue(ConfirmStrProperty, value);
|
||||
}
|
||||
|
||||
public bool ShowDateTime
|
||||
{
|
||||
get => (bool)GetValue(ShowDateTimeProperty);
|
||||
get => (bool) GetValue(ShowDateTimeProperty);
|
||||
set => SetValue(ShowDateTimeProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get => (string)GetValue(MessageProperty);
|
||||
get => (string) GetValue(MessageProperty);
|
||||
set => SetValue(MessageProperty, value);
|
||||
}
|
||||
|
||||
public DateTime Time
|
||||
{
|
||||
get => (DateTime)GetValue(TimeProperty);
|
||||
get => (DateTime) GetValue(TimeProperty);
|
||||
set => SetValue(TimeProperty, value);
|
||||
}
|
||||
|
||||
public Geometry Icon
|
||||
{
|
||||
get => (Geometry)GetValue(IconProperty);
|
||||
get => (Geometry) GetValue(IconProperty);
|
||||
set => SetValue(IconProperty, value);
|
||||
}
|
||||
|
||||
public Brush IconBrush
|
||||
{
|
||||
get => (Brush)GetValue(IconBrushProperty);
|
||||
get => (Brush) GetValue(IconBrushProperty);
|
||||
set => SetValue(IconBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -848,4 +848,4 @@ namespace HandyControl.Controls
|
||||
|
||||
private void ButtonOk_OnClick(object sender, RoutedEventArgs e) => Close(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,4 +34,4 @@ namespace HandyControl.Controls
|
||||
Top = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ namespace HandyControl.Controls
|
||||
|
||||
if (e.NewValue != null)
|
||||
{
|
||||
var v = (Uri)e.NewValue;
|
||||
var v = (Uri) e.NewValue;
|
||||
ctl.GetGifStreamFromPack(v);
|
||||
ctl.StartAnimate();
|
||||
}
|
||||
@@ -62,8 +62,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnVisibilityChanged(DependencyObject s, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (GifImage)s;
|
||||
var v = (Visibility)e.NewValue;
|
||||
var ctl = (GifImage) s;
|
||||
var v = (Visibility) e.NewValue;
|
||||
if (v != Visibility.Visible)
|
||||
{
|
||||
ctl.StopAnimate();
|
||||
@@ -244,8 +244,8 @@ namespace HandyControl.Controls
|
||||
created = dataStream = File.OpenRead(filename);
|
||||
}
|
||||
|
||||
image._rawData = new byte[(int)dataStream.Length];
|
||||
dataStream.Read(image._rawData, 0, (int)dataStream.Length);
|
||||
image._rawData = new byte[(int) dataStream.Length];
|
||||
dataStream.Read(image._rawData, 0, (int) dataStream.Length);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -356,7 +356,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
guids[i] = (Guid)InteropMethods.PtrToStructure((IntPtr)((long)buffer + size * i), typeof(Guid));
|
||||
guids[i] = (Guid) InteropMethods.PtrToStructure((IntPtr) ((long) buffer + size * i), typeof(Guid));
|
||||
}
|
||||
}
|
||||
finally
|
||||
@@ -491,4 +491,4 @@ namespace HandyControl.Controls
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private void ImageBlock_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if(IsVisible)
|
||||
if (IsVisible)
|
||||
{
|
||||
_dispatcherTimer.Tick += DispatcherTimer_Tick;
|
||||
if (IsPlaying)
|
||||
@@ -80,11 +80,11 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnPositionsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (ImageBlock)d;
|
||||
var ctl = (ImageBlock) d;
|
||||
|
||||
if (e.Property == ColumnsProperty)
|
||||
{
|
||||
ctl._columns = (int)e.NewValue;
|
||||
ctl._columns = (int) e.NewValue;
|
||||
}
|
||||
|
||||
ctl.UpdateDatas();
|
||||
@@ -138,7 +138,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnIsPlayingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (ImageBlock)d;
|
||||
var ctl = (ImageBlock) d;
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
ctl._dispatcherTimer.Start();
|
||||
@@ -157,7 +157,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static readonly DependencyProperty ColumnsProperty = DependencyProperty.Register(
|
||||
"Columns", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int1Box,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int)obj >= 1);
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int) obj >= 1);
|
||||
|
||||
public int Columns
|
||||
{
|
||||
@@ -167,7 +167,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static readonly DependencyProperty RowsProperty = DependencyProperty.Register(
|
||||
"Rows", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int1Box,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int)obj >= 1);
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int) obj >= 1);
|
||||
|
||||
public int Rows
|
||||
{
|
||||
@@ -196,14 +196,14 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (ImageBlock)d;
|
||||
var ctl = (ImageBlock) d;
|
||||
ctl._source = e.NewValue as BitmapSource;
|
||||
ctl.UpdateDatas();
|
||||
}
|
||||
|
||||
public ImageSource Source
|
||||
{
|
||||
get => (ImageSource)GetValue(SourceProperty);
|
||||
get => (ImageSource) GetValue(SourceProperty);
|
||||
set => SetValue(SourceProperty, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -270,19 +270,19 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsFullScreen
|
||||
{
|
||||
get => (bool)GetValue(IsFullScreenProperty);
|
||||
get => (bool) GetValue(IsFullScreenProperty);
|
||||
set => SetValue(IsFullScreenProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
public bool ShowImgMap
|
||||
{
|
||||
get => (bool)GetValue(ShowImgMapProperty);
|
||||
get => (bool) GetValue(ShowImgMapProperty);
|
||||
set => SetValue(ShowImgMapProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
public BitmapFrame ImageSource
|
||||
{
|
||||
get => (BitmapFrame)GetValue(ImageSourceProperty);
|
||||
get => (BitmapFrame) GetValue(ImageSourceProperty);
|
||||
set => SetValue(ImageSourceProperty, value);
|
||||
}
|
||||
|
||||
@@ -294,13 +294,13 @@ namespace HandyControl.Controls
|
||||
|
||||
internal string ImgPath
|
||||
{
|
||||
get => (string)GetValue(ImgPathProperty);
|
||||
get => (string) GetValue(ImgPathProperty);
|
||||
set => SetValue(ImgPathProperty, value);
|
||||
}
|
||||
|
||||
internal long ImgSize
|
||||
{
|
||||
get => (long)GetValue(ImgSizeProperty);
|
||||
get => (long) GetValue(ImgSizeProperty);
|
||||
set => SetValue(ImgSizeProperty, value);
|
||||
}
|
||||
|
||||
@@ -309,49 +309,49 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
internal bool ShowFullScreenButton
|
||||
{
|
||||
get => (bool)GetValue(ShowFullScreenButtonProperty);
|
||||
get => (bool) GetValue(ShowFullScreenButtonProperty);
|
||||
set => SetValue(ShowFullScreenButtonProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
internal Thickness ImageMargin
|
||||
{
|
||||
get => (Thickness)GetValue(ImageMarginProperty);
|
||||
get => (Thickness) GetValue(ImageMarginProperty);
|
||||
set => SetValue(ImageMarginProperty, value);
|
||||
}
|
||||
|
||||
internal double ImageWidth
|
||||
{
|
||||
get => (double)GetValue(ImageWidthProperty);
|
||||
get => (double) GetValue(ImageWidthProperty);
|
||||
set => SetValue(ImageWidthProperty, value);
|
||||
}
|
||||
|
||||
internal double ImageHeight
|
||||
{
|
||||
get => (double)GetValue(ImageHeightProperty);
|
||||
get => (double) GetValue(ImageHeightProperty);
|
||||
set => SetValue(ImageHeightProperty, value);
|
||||
}
|
||||
|
||||
internal double ImageScale
|
||||
{
|
||||
get => (double)GetValue(ImageScaleProperty);
|
||||
get => (double) GetValue(ImageScaleProperty);
|
||||
set => SetValue(ImageScaleProperty, value);
|
||||
}
|
||||
|
||||
internal string ScaleStr
|
||||
{
|
||||
get => (string)GetValue(ScaleStrProperty);
|
||||
get => (string) GetValue(ScaleStrProperty);
|
||||
set => SetValue(ScaleStrProperty, value);
|
||||
}
|
||||
|
||||
internal double ImageRotate
|
||||
{
|
||||
get => (double)GetValue(ImageRotateProperty);
|
||||
get => (double) GetValue(ImageRotateProperty);
|
||||
set => SetValue(ImageRotateProperty, value);
|
||||
}
|
||||
|
||||
internal bool ShowSmallImgInternal
|
||||
{
|
||||
get => (bool)GetValue(ShowSmallImgInternalProperty);
|
||||
get => (bool) GetValue(ShowSmallImgInternalProperty);
|
||||
set => SetValue(ShowSmallImgInternalProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
internal bool ShowCloseButton
|
||||
{
|
||||
get => (bool)GetValue(ShowCloseButtonProperty);
|
||||
get => (bool) GetValue(ShowCloseButtonProperty);
|
||||
set => SetValue(ShowCloseButtonProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -811,7 +811,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
_imgActualRotate = rotate;
|
||||
|
||||
_isOblique = ((int)_imgActualRotate - 90) % 180 == 0;
|
||||
_isOblique = ((int) _imgActualRotate - 90) % 180 == 0;
|
||||
ShowSmallImgInternal = false;
|
||||
Init();
|
||||
InitBorderSmall();
|
||||
@@ -918,4 +918,4 @@ namespace HandyControl.Controls
|
||||
|
||||
private void CanvasSmallImg_OnMouseLeave(object sender, MouseEventArgs e) => _imgSmallIsMouseLeftButtonDown = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -176,7 +176,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public bool IsError
|
||||
{
|
||||
get => (bool)GetValue(IsErrorProperty);
|
||||
get => (bool) GetValue(IsErrorProperty);
|
||||
set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public string ErrorStr
|
||||
{
|
||||
get => (string)GetValue(ErrorStrProperty);
|
||||
get => (string) GetValue(ErrorStrProperty);
|
||||
set => SetValue(ErrorStrProperty, value);
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public TextType TextType
|
||||
{
|
||||
get => (TextType)GetValue(TextTypeProperty);
|
||||
get => (TextType) GetValue(TextTypeProperty);
|
||||
set => SetValue(TextTypeProperty, value);
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public bool ShowClearButton
|
||||
{
|
||||
get => (bool)GetValue(ShowClearButtonProperty);
|
||||
get => (bool) GetValue(ShowClearButtonProperty);
|
||||
set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnAutoCompleteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (ComboBox)d;
|
||||
var ctl = (ComboBox) d;
|
||||
if (ctl._editableTextBox != null)
|
||||
{
|
||||
ctl.UpdateSearchItems(ctl._editableTextBox.Text);
|
||||
@@ -251,7 +251,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public bool AutoComplete
|
||||
{
|
||||
get => (bool)GetValue(AutoCompleteProperty);
|
||||
get => (bool) GetValue(AutoCompleteProperty);
|
||||
set => SetValue(AutoCompleteProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnSearchTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (ComboBox)d;
|
||||
var ctl = (ComboBox) d;
|
||||
if (ctl._isAutoCompleteAction)
|
||||
{
|
||||
#if NET40
|
||||
@@ -283,7 +283,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
internal string SearchText
|
||||
{
|
||||
get => (string)GetValue(SearchTextProperty);
|
||||
get => (string) GetValue(SearchTextProperty);
|
||||
set => SetValue(SearchTextProperty, value);
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionTextBrushProperty);
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double SelectionOpacity
|
||||
{
|
||||
get => (double)GetValue(SelectionOpacityProperty);
|
||||
get => (double) GetValue(SelectionOpacityProperty);
|
||||
set => SetValue(SelectionOpacityProperty, value);
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush CaretBrush
|
||||
{
|
||||
get => (Brush)GetValue(CaretBrushProperty);
|
||||
get => (Brush) GetValue(CaretBrushProperty);
|
||||
set => SetValue(CaretBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -425,4 +425,4 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionBrushProperty);
|
||||
get => (Brush) GetValue(SelectionBrushProperty);
|
||||
set => SetValue(SelectionBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionTextBrushProperty);
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double SelectionOpacity
|
||||
{
|
||||
get => (double)GetValue(SelectionOpacityProperty);
|
||||
get => (double) GetValue(SelectionOpacityProperty);
|
||||
set => SetValue(SelectionOpacityProperty, value);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush CaretBrush
|
||||
{
|
||||
get => (Brush)GetValue(CaretBrushProperty);
|
||||
get => (Brush) GetValue(CaretBrushProperty);
|
||||
set => SetValue(CaretBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -158,4 +158,4 @@ namespace HandyControl.Controls
|
||||
return result.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,8 +115,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static object CoerceDisplayDateTime(DependencyObject d, object value)
|
||||
{
|
||||
var dp = (DateTimePicker)d;
|
||||
dp._calendarWithClock.DisplayDateTime = (DateTime)value;
|
||||
var dp = (DateTimePicker) d;
|
||||
dp._calendarWithClock.DisplayDateTime = (DateTime) value;
|
||||
|
||||
return dp._calendarWithClock.DisplayDateTime;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
var dp = d as DateTimePicker;
|
||||
|
||||
var newValue = (bool)e.NewValue;
|
||||
var newValue = (bool) e.NewValue;
|
||||
if (dp?._popup != null && dp._popup.IsOpen != newValue)
|
||||
{
|
||||
dp._popup.IsOpen = newValue;
|
||||
@@ -144,10 +144,10 @@ namespace HandyControl.Controls
|
||||
{
|
||||
dp._originalSelectedDateTime = dp.SelectedDateTime;
|
||||
|
||||
dp.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action)delegate
|
||||
{
|
||||
dp._calendarWithClock.Focus();
|
||||
});
|
||||
dp.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action) delegate
|
||||
{
|
||||
dp._calendarWithClock.Focus();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -163,8 +163,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static object CoerceSelectedDateTime(DependencyObject d, object value)
|
||||
{
|
||||
var dp = (DateTimePicker)d;
|
||||
dp._calendarWithClock.SelectedDateTime = (DateTime?)value;
|
||||
var dp = (DateTimePicker) d;
|
||||
dp._calendarWithClock.SelectedDateTime = (DateTime?) value;
|
||||
return dp._calendarWithClock.SelectedDateTime;
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionBrushProperty);
|
||||
get => (Brush) GetValue(SelectionBrushProperty);
|
||||
set => SetValue(SelectionBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionTextBrushProperty);
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double SelectionOpacity
|
||||
{
|
||||
get => (double)GetValue(SelectionOpacityProperty);
|
||||
get => (double) GetValue(SelectionOpacityProperty);
|
||||
set => SetValue(SelectionOpacityProperty, value);
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush CaretBrush
|
||||
{
|
||||
get => (Brush)GetValue(CaretBrushProperty);
|
||||
get => (Brush) GetValue(CaretBrushProperty);
|
||||
set => SetValue(CaretBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -645,7 +645,7 @@ namespace HandyControl.Controls
|
||||
|
||||
if (d != null)
|
||||
{
|
||||
SafeSetText(DateTimeToString((DateTime)d));
|
||||
SafeSetText(DateTimeToString((DateTime) d));
|
||||
return d;
|
||||
}
|
||||
|
||||
@@ -711,7 +711,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnGotFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var picker = (DateTimePicker)sender;
|
||||
var picker = (DateTimePicker) sender;
|
||||
if (!e.Handled && picker._textBox != null)
|
||||
{
|
||||
if (Equals(e.OriginalSource, picker))
|
||||
@@ -729,4 +729,4 @@ namespace HandyControl.Controls
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,4 +40,4 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
bool ShowClearButton { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
Stretch = Stretch
|
||||
});
|
||||
SetValue(HasValuePropertyKey, ValueBoxes.TrueBox);
|
||||
SetValue(HasValuePropertyKey, ValueBoxes.TrueBox);
|
||||
SetCurrentValue(ToolTipProperty, dialog.FileName);
|
||||
}
|
||||
}
|
||||
@@ -123,4 +123,4 @@ namespace HandyControl.Controls
|
||||
set => SetValue(HasValueProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
@@ -187,8 +187,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (NumericUpDown)d;
|
||||
var v = (double)e.NewValue;
|
||||
var ctl = (NumericUpDown) d;
|
||||
var v = (double) e.NewValue;
|
||||
ctl.SetText();
|
||||
|
||||
ctl.OnValueChanged(new FunctionEventArgs<double>(ValueChangedEvent, ctl)
|
||||
@@ -208,9 +208,9 @@ namespace HandyControl.Controls
|
||||
|
||||
private static object CoerceValue(DependencyObject d, object basevalue)
|
||||
{
|
||||
var ctl = (NumericUpDown)d;
|
||||
var ctl = (NumericUpDown) d;
|
||||
var minimum = ctl.Minimum;
|
||||
var num = (double)basevalue;
|
||||
var num = (double) basevalue;
|
||||
if (num < minimum)
|
||||
{
|
||||
ctl.Value = minimum;
|
||||
@@ -230,7 +230,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public double Value
|
||||
{
|
||||
get => (double)GetValue(ValueProperty);
|
||||
get => (double) GetValue(ValueProperty);
|
||||
set => SetValue(ValueProperty, value);
|
||||
}
|
||||
|
||||
@@ -242,15 +242,15 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (NumericUpDown)d;
|
||||
var ctl = (NumericUpDown) d;
|
||||
ctl.CoerceValue(MinimumProperty);
|
||||
ctl.CoerceValue(ValueProperty);
|
||||
}
|
||||
|
||||
private static object CoerceMaximum(DependencyObject d, object basevalue)
|
||||
{
|
||||
var minimum = ((NumericUpDown)d).Minimum;
|
||||
return (double)basevalue < minimum ? minimum : basevalue;
|
||||
var minimum = ((NumericUpDown) d).Minimum;
|
||||
return (double) basevalue < minimum ? minimum : basevalue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -258,7 +258,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public double Maximum
|
||||
{
|
||||
get => (double)GetValue(MaximumProperty);
|
||||
get => (double) GetValue(MaximumProperty);
|
||||
set => SetValue(MaximumProperty, value);
|
||||
}
|
||||
|
||||
@@ -270,15 +270,15 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (NumericUpDown)d;
|
||||
var ctl = (NumericUpDown) d;
|
||||
ctl.CoerceValue(MaximumProperty);
|
||||
ctl.CoerceValue(ValueProperty);
|
||||
}
|
||||
|
||||
private static object CoerceMinimum(DependencyObject d, object basevalue)
|
||||
{
|
||||
var maximum = ((NumericUpDown)d).Maximum;
|
||||
return (double)basevalue > maximum ? maximum : basevalue;
|
||||
var maximum = ((NumericUpDown) d).Maximum;
|
||||
return (double) basevalue > maximum ? maximum : basevalue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -286,7 +286,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public double Minimum
|
||||
{
|
||||
get => (double)GetValue(MinimumProperty);
|
||||
get => (double) GetValue(MinimumProperty);
|
||||
set => SetValue(MinimumProperty, value);
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public double Increment
|
||||
{
|
||||
get => (double)GetValue(IncrementProperty);
|
||||
get => (double) GetValue(IncrementProperty);
|
||||
set => SetValue(IncrementProperty, value);
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public int? DecimalPlaces
|
||||
{
|
||||
get => (int?)GetValue(DecimalPlacesProperty);
|
||||
get => (int?) GetValue(DecimalPlacesProperty);
|
||||
set => SetValue(DecimalPlacesProperty, value);
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
internal bool ShowUpDownButton
|
||||
{
|
||||
get => (bool)GetValue(ShowUpDownButtonProperty);
|
||||
get => (bool) GetValue(ShowUpDownButtonProperty);
|
||||
set => SetValue(ShowUpDownButtonProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsError
|
||||
{
|
||||
get => (bool)GetValue(IsErrorProperty);
|
||||
get => (bool) GetValue(IsErrorProperty);
|
||||
set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public string ErrorStr
|
||||
{
|
||||
get => (string)GetValue(ErrorStrProperty);
|
||||
get => (string) GetValue(ErrorStrProperty);
|
||||
set => SetValue(ErrorStrProperty, value);
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public TextType TextType
|
||||
{
|
||||
get => (TextType)GetValue(TextTypeProperty);
|
||||
get => (TextType) GetValue(TextTypeProperty);
|
||||
set => SetValue(TextTypeProperty, value);
|
||||
}
|
||||
|
||||
@@ -397,7 +397,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool ShowClearButton
|
||||
{
|
||||
get => (bool)GetValue(ShowClearButtonProperty);
|
||||
get => (bool) GetValue(ShowClearButtonProperty);
|
||||
set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get => (bool)GetValue(IsReadOnlyProperty);
|
||||
get => (bool) GetValue(IsReadOnlyProperty);
|
||||
set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -421,7 +421,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionBrushProperty);
|
||||
get => (Brush) GetValue(SelectionBrushProperty);
|
||||
set => SetValue(SelectionBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionTextBrushProperty);
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double SelectionOpacity
|
||||
{
|
||||
get => (double)GetValue(SelectionOpacityProperty);
|
||||
get => (double) GetValue(SelectionOpacityProperty);
|
||||
set => SetValue(SelectionOpacityProperty, value);
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush CaretBrush
|
||||
{
|
||||
get => (Brush)GetValue(CaretBrushProperty);
|
||||
get => (Brush) GetValue(CaretBrushProperty);
|
||||
set => SetValue(CaretBrushProperty, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public char PasswordChar
|
||||
{
|
||||
get => (char)GetValue(PasswordCharProperty);
|
||||
get => (char) GetValue(PasswordCharProperty);
|
||||
set => SetValue(PasswordCharProperty, value);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsError
|
||||
{
|
||||
get => (bool)GetValue(IsErrorProperty);
|
||||
get => (bool) GetValue(IsErrorProperty);
|
||||
set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public string ErrorStr
|
||||
{
|
||||
get => (string)GetValue(ErrorStrProperty);
|
||||
get => (string) GetValue(ErrorStrProperty);
|
||||
set => SetValue(ErrorStrProperty, value);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public TextType TextType
|
||||
{
|
||||
get => (TextType)GetValue(TextTypeProperty);
|
||||
get => (TextType) GetValue(TextTypeProperty);
|
||||
set => SetValue(TextTypeProperty, value);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool ShowClearButton
|
||||
{
|
||||
get => (bool)GetValue(ShowClearButtonProperty);
|
||||
get => (bool) GetValue(ShowClearButtonProperty);
|
||||
set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool ShowEyeButton
|
||||
{
|
||||
get => (bool)GetValue(ShowEyeButtonProperty);
|
||||
get => (bool) GetValue(ShowEyeButtonProperty);
|
||||
set => SetValue(ShowEyeButtonProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool ShowPassword
|
||||
{
|
||||
get => (bool)GetValue(ShowPasswordProperty);
|
||||
get => (bool) GetValue(ShowPasswordProperty);
|
||||
set => SetValue(ShowPasswordProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -111,8 +111,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnIsSafeEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var p = (PasswordBox)d;
|
||||
p.SetCurrentValue(UnsafePasswordProperty, !(bool)e.NewValue ? p.Password : string.Empty);
|
||||
var p = (PasswordBox) d;
|
||||
p.SetCurrentValue(UnsafePasswordProperty, !(bool) e.NewValue ? p.Password : string.Empty);
|
||||
}
|
||||
|
||||
public bool IsSafeEnabled
|
||||
@@ -122,7 +122,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty UnsafePasswordProperty = DependencyProperty.Register(
|
||||
"UnsafePassword", typeof(string), typeof(PasswordBox), new FrameworkPropertyMetadata(default(string),
|
||||
"UnsafePassword", typeof(string), typeof(PasswordBox), new FrameworkPropertyMetadata(default(string),
|
||||
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnUnsafePasswordChanged));
|
||||
|
||||
private static void OnUnsafePasswordChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
@@ -145,7 +145,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public int MaxLength
|
||||
{
|
||||
get => (int)GetValue(MaxLengthProperty);
|
||||
get => (int) GetValue(MaxLengthProperty);
|
||||
set => SetValue(MaxLengthProperty, value);
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionBrushProperty);
|
||||
get => (Brush) GetValue(SelectionBrushProperty);
|
||||
set => SetValue(SelectionBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionTextBrushProperty);
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double SelectionOpacity
|
||||
{
|
||||
get => (double)GetValue(SelectionOpacityProperty);
|
||||
get => (double) GetValue(SelectionOpacityProperty);
|
||||
set => SetValue(SelectionOpacityProperty, value);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush CaretBrush
|
||||
{
|
||||
get => (Brush)GetValue(CaretBrushProperty);
|
||||
get => (Brush) GetValue(CaretBrushProperty);
|
||||
set => SetValue(CaretBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -265,9 +265,9 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnShowPasswordChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (PasswordBox)d;
|
||||
var ctl = (PasswordBox) d;
|
||||
if (!ctl.ShowEyeButton) return;
|
||||
if ((bool)e.NewValue)
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
ctl._textBox.Text = ctl.ActualPasswordBox.Password;
|
||||
ctl._textBox.Select(string.IsNullOrEmpty(ctl._textBox.Text) ? 0 : ctl._textBox.Text.Length, 0);
|
||||
@@ -370,4 +370,4 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
RemoveHandler(System.Windows.Controls.PasswordBox.PasswordChangedEvent, _passwordBoxsPasswordChangedEventHandler);
|
||||
RemoveHandler(GotFocusEvent, _passwordBoxsGotFocusEventHandler);
|
||||
|
||||
|
||||
Loaded -= PinBox_Loaded;
|
||||
Unloaded -= PinBox_Unloaded;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
_passwordBoxsPasswordChangedEventHandler = PasswordBoxsPasswordChanged;
|
||||
AddHandler(System.Windows.Controls.PasswordBox.PasswordChangedEvent, _passwordBoxsPasswordChangedEventHandler);
|
||||
|
||||
|
||||
_passwordBoxsGotFocusEventHandler = PasswordBoxsGotFocus;
|
||||
AddHandler(GotFocusEvent, _passwordBoxsGotFocusEventHandler);
|
||||
}
|
||||
@@ -211,7 +211,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public char PasswordChar
|
||||
{
|
||||
get => (char)GetValue(PasswordCharProperty);
|
||||
get => (char) GetValue(PasswordCharProperty);
|
||||
set => SetValue(PasswordCharProperty, value);
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ namespace HandyControl.Controls
|
||||
ctl.UpdateItems();
|
||||
}
|
||||
|
||||
private static object CoerceLength(DependencyObject d, object basevalue) => (int)basevalue < 4 ? MinLength : basevalue;
|
||||
private static object CoerceLength(DependencyObject d, object basevalue) => (int) basevalue < 4 ? MinLength : basevalue;
|
||||
|
||||
public int Length
|
||||
{
|
||||
@@ -264,7 +264,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionBrushProperty);
|
||||
get => (Brush) GetValue(SelectionBrushProperty);
|
||||
set => SetValue(SelectionBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionTextBrushProperty);
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double SelectionOpacity
|
||||
{
|
||||
get => (double)GetValue(SelectionOpacityProperty);
|
||||
get => (double) GetValue(SelectionOpacityProperty);
|
||||
set => SetValue(SelectionOpacityProperty, value);
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush CaretBrush
|
||||
{
|
||||
get => (Brush)GetValue(CaretBrushProperty);
|
||||
get => (Brush) GetValue(CaretBrushProperty);
|
||||
set => SetValue(CaretBrushProperty, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public bool IsRealTime
|
||||
{
|
||||
get => (bool)GetValue(IsRealTimeProperty);
|
||||
get => (bool) GetValue(IsRealTimeProperty);
|
||||
set => SetValue(IsRealTimeProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (SearchBar)d;
|
||||
var ctl = (SearchBar) d;
|
||||
if (e.OldValue is ICommand oldCommand)
|
||||
{
|
||||
oldCommand.CanExecuteChanged -= ctl.CanExecuteChanged;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public string ErrorStr
|
||||
{
|
||||
get => (string)GetValue(ErrorStrProperty);
|
||||
get => (string) GetValue(ErrorStrProperty);
|
||||
set => SetValue(ErrorStrProperty, value);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public TextType TextType
|
||||
{
|
||||
get => (TextType)GetValue(TextTypeProperty);
|
||||
get => (TextType) GetValue(TextTypeProperty);
|
||||
set => SetValue(TextTypeProperty, value);
|
||||
}
|
||||
|
||||
@@ -117,4 +117,4 @@ namespace HandyControl.Controls
|
||||
return result.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public string TimeFormat
|
||||
{
|
||||
get => (string)GetValue(TimeFormatProperty);
|
||||
get => (string) GetValue(TimeFormatProperty);
|
||||
set => SetValue(TimeFormatProperty, value);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public DateTime DisplayTime
|
||||
{
|
||||
get => (DateTime)GetValue(DisplayTimeProperty);
|
||||
get => (DateTime) GetValue(DisplayTimeProperty);
|
||||
set => SetValue(DisplayTimeProperty, value);
|
||||
}
|
||||
|
||||
@@ -120,8 +120,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static object CoerceDisplayTime(DependencyObject d, object value)
|
||||
{
|
||||
var dp = (TimePicker)d;
|
||||
dp.Clock.DisplayTime = (DateTime)value;
|
||||
var dp = (TimePicker) d;
|
||||
dp.Clock.DisplayTime = (DateTime) value;
|
||||
return dp.Clock.DisplayTime;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsDropDownOpen
|
||||
{
|
||||
get => (bool)GetValue(IsDropDownOpenProperty);
|
||||
get => (bool) GetValue(IsDropDownOpenProperty);
|
||||
set => SetValue(IsDropDownOpenProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
var dp = d as TimePicker;
|
||||
|
||||
var newValue = (bool)e.NewValue;
|
||||
var newValue = (bool) e.NewValue;
|
||||
if (dp?._popup != null && dp._popup.IsOpen != newValue)
|
||||
{
|
||||
dp._popup.IsOpen = newValue;
|
||||
@@ -156,10 +156,10 @@ namespace HandyControl.Controls
|
||||
{
|
||||
dp._originalSelectedTime = dp.SelectedTime;
|
||||
|
||||
dp.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action)delegate
|
||||
{
|
||||
dp.Clock.Focus();
|
||||
});
|
||||
dp.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action) delegate
|
||||
{
|
||||
dp.Clock.Focus();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,7 +170,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public DateTime? SelectedTime
|
||||
{
|
||||
get => (DateTime?)GetValue(SelectedTimeProperty);
|
||||
get => (DateTime?) GetValue(SelectedTimeProperty);
|
||||
set => SetValue(SelectedTimeProperty, value);
|
||||
}
|
||||
|
||||
@@ -199,8 +199,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static object CoerceSelectedTime(DependencyObject d, object value)
|
||||
{
|
||||
var dp = (TimePicker)d;
|
||||
dp.Clock.SelectedTime = (DateTime?)value;
|
||||
var dp = (TimePicker) d;
|
||||
dp.Clock.SelectedTime = (DateTime?) value;
|
||||
return dp.Clock.SelectedTime;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public string Text
|
||||
{
|
||||
get => (string)GetValue(TextProperty);
|
||||
get => (string) GetValue(TextProperty);
|
||||
set => SetValue(TextProperty, value);
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsError
|
||||
{
|
||||
get => (bool)GetValue(IsErrorProperty);
|
||||
get => (bool) GetValue(IsErrorProperty);
|
||||
set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public string ErrorStr
|
||||
{
|
||||
get => (string)GetValue(ErrorStrProperty);
|
||||
get => (string) GetValue(ErrorStrProperty);
|
||||
set => SetValue(ErrorStrProperty, value);
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public TextType TextType
|
||||
{
|
||||
get => (TextType)GetValue(TextTypeProperty);
|
||||
get => (TextType) GetValue(TextTypeProperty);
|
||||
set => SetValue(TextTypeProperty, value);
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool ShowClearButton
|
||||
{
|
||||
get => (bool)GetValue(ShowClearButtonProperty);
|
||||
get => (bool) GetValue(ShowClearButtonProperty);
|
||||
set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionBrushProperty);
|
||||
get => (Brush) GetValue(SelectionBrushProperty);
|
||||
set => SetValue(SelectionBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush)GetValue(SelectionTextBrushProperty);
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double SelectionOpacity
|
||||
{
|
||||
get => (double)GetValue(SelectionOpacityProperty);
|
||||
get => (double) GetValue(SelectionOpacityProperty);
|
||||
set => SetValue(SelectionOpacityProperty, value);
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Brush CaretBrush
|
||||
{
|
||||
get => (Brush)GetValue(CaretBrushProperty);
|
||||
get => (Brush) GetValue(CaretBrushProperty);
|
||||
set => SetValue(CaretBrushProperty, value);
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnClockChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (TimePicker)d;
|
||||
var ctl = (TimePicker) d;
|
||||
var oldClock = e.OldValue as ClockBase;
|
||||
var newClock = e.NewValue as ClockBase;
|
||||
|
||||
@@ -359,7 +359,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public ClockBase Clock
|
||||
{
|
||||
get => (ClockBase)GetValue(ClockProperty);
|
||||
get => (ClockBase) GetValue(ClockProperty);
|
||||
set => SetValue(ClockProperty, value);
|
||||
}
|
||||
|
||||
@@ -469,7 +469,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
else
|
||||
{
|
||||
_textBox.Text = DateTimeToString((DateTime)SelectedTime);
|
||||
_textBox.Text = DateTimeToString((DateTime) SelectedTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -685,13 +685,13 @@ namespace HandyControl.Controls
|
||||
|
||||
if (d != null)
|
||||
{
|
||||
SafeSetText(DateTimeToString((DateTime)d));
|
||||
SafeSetText(DateTimeToString((DateTime) d));
|
||||
return d;
|
||||
}
|
||||
|
||||
if (SelectedTime != null)
|
||||
{
|
||||
var newtext = DateTimeToString((DateTime)SelectedTime);
|
||||
var newtext = DateTimeToString((DateTime) SelectedTime);
|
||||
SafeSetText(newtext);
|
||||
return SelectedTime;
|
||||
}
|
||||
@@ -746,7 +746,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnGotFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var picker = (TimePicker)sender;
|
||||
var picker = (TimePicker) sender;
|
||||
if (!e.Handled && picker._textBox != null)
|
||||
{
|
||||
if (Equals(e.OriginalSource, picker))
|
||||
@@ -764,4 +764,4 @@ namespace HandyControl.Controls
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,4 +33,4 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,4 +61,4 @@ namespace HandyControl.Controls
|
||||
return arrangeSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,12 +125,12 @@ namespace HandyControl.Controls
|
||||
protected virtual Ellipse CreateEllipse(int index)
|
||||
{
|
||||
var ellipse = new Ellipse();
|
||||
ellipse.SetBinding(WidthProperty, new Binding(DotDiameterProperty.Name) {Source = this});
|
||||
ellipse.SetBinding(HeightProperty, new Binding(DotDiameterProperty.Name) {Source = this});
|
||||
ellipse.SetBinding(Shape.FillProperty, new Binding(ForegroundProperty.Name) {Source = this});
|
||||
ellipse.SetBinding(Shape.StrokeThicknessProperty, new Binding(DotBorderThicknessProperty.Name) {Source = this});
|
||||
ellipse.SetBinding(Shape.StrokeProperty, new Binding(DotBorderBrushProperty.Name) {Source = this});
|
||||
ellipse.SetBinding(WidthProperty, new Binding(DotDiameterProperty.Name) { Source = this });
|
||||
ellipse.SetBinding(HeightProperty, new Binding(DotDiameterProperty.Name) { Source = this });
|
||||
ellipse.SetBinding(Shape.FillProperty, new Binding(ForegroundProperty.Name) { Source = this });
|
||||
ellipse.SetBinding(Shape.StrokeThicknessProperty, new Binding(DotBorderThicknessProperty.Name) { Source = this });
|
||||
ellipse.SetBinding(Shape.StrokeProperty, new Binding(DotBorderBrushProperty.Name) { Source = this });
|
||||
return ellipse;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,4 +206,4 @@ namespace HandyControl.Controls
|
||||
return border;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,11 +12,11 @@ namespace HandyControl.Controls
|
||||
private const double MoveLength = 80;
|
||||
|
||||
private const double UniformScale = .6;
|
||||
|
||||
|
||||
public LoadingLine()
|
||||
{
|
||||
SetBinding(HeightProperty, new Binding("DotDiameter") { Source = this });
|
||||
}
|
||||
}
|
||||
|
||||
protected sealed override void UpdateDots()
|
||||
{
|
||||
@@ -64,7 +64,7 @@ namespace HandyControl.Controls
|
||||
EasingMode = EasingMode.EaseOut
|
||||
},
|
||||
Value = new Thickness(speedDownLength + ellipse.Margin.Left, 0, 0, 0),
|
||||
KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(dotSpeed * (1 - UniformScale)/2))
|
||||
KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(dotSpeed * (1 - UniformScale) / 2))
|
||||
};
|
||||
|
||||
//匀速开始到匀速结束
|
||||
@@ -109,4 +109,4 @@ namespace HandyControl.Controls
|
||||
return ellipse;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public Geometry Data
|
||||
{
|
||||
get => (Geometry)GetValue(DataProperty);
|
||||
get => (Geometry) GetValue(DataProperty);
|
||||
set => SetValue(DataProperty, value);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public double PathLength
|
||||
{
|
||||
get => (double)GetValue(PathLengthProperty);
|
||||
get => (double) GetValue(PathLengthProperty);
|
||||
set => SetValue(PathLengthProperty, value);
|
||||
}
|
||||
|
||||
@@ -75,15 +75,15 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public Duration Duration
|
||||
{
|
||||
get => (Duration)GetValue(DurationProperty);
|
||||
get => (Duration) GetValue(DurationProperty);
|
||||
set => SetValue(DurationProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IsPlayingProperty = DependencyProperty.Register(
|
||||
"IsPlaying", typeof(bool), typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, (o, args) =>
|
||||
{
|
||||
var ctl = (AnimationPath)o;
|
||||
var v = (bool)args.NewValue;
|
||||
var ctl = (AnimationPath) o;
|
||||
var v = (bool) args.NewValue;
|
||||
if (v)
|
||||
{
|
||||
ctl.UpdatePath();
|
||||
@@ -99,7 +99,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public bool IsPlaying
|
||||
{
|
||||
get => (bool)GetValue(IsPlayingProperty);
|
||||
get => (bool) GetValue(IsPlayingProperty);
|
||||
set => SetValue(IsPlayingProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public RepeatBehavior RepeatBehavior
|
||||
{
|
||||
get => (RepeatBehavior)GetValue(RepeatBehaviorProperty);
|
||||
get => (RepeatBehavior) GetValue(RepeatBehaviorProperty);
|
||||
set => SetValue(RepeatBehaviorProperty, value);
|
||||
}
|
||||
|
||||
@@ -197,4 +197,4 @@ namespace HandyControl.Controls
|
||||
|
||||
private void Storyboard_Completed(object sender, EventArgs e) => RaiseEvent(new RoutedEventArgs(CompletedEvent));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,8 +35,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (Badge)d;
|
||||
var v = (int)e.NewValue;
|
||||
var ctl = (Badge) d;
|
||||
var v = (int) e.NewValue;
|
||||
ctl.Text = v <= ctl.Maximum ? v.ToString() : $"{ctl.Maximum}+";
|
||||
if (ctl.IsInitialized)
|
||||
{
|
||||
@@ -49,7 +49,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public int Value
|
||||
{
|
||||
get => (int)GetValue(ValueProperty);
|
||||
get => (int) GetValue(ValueProperty);
|
||||
set => SetValue(ValueProperty, value);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public BadgeStatus Status
|
||||
{
|
||||
get => (BadgeStatus)GetValue(StatusProperty);
|
||||
get => (BadgeStatus) GetValue(StatusProperty);
|
||||
set => SetValue(StatusProperty, value);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public int Maximum
|
||||
{
|
||||
get => (int)GetValue(MaximumProperty);
|
||||
get => (int) GetValue(MaximumProperty);
|
||||
set => SetValue(MaximumProperty, value);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Thickness BadgeMargin
|
||||
{
|
||||
get => (Thickness)GetValue(BadgeMarginProperty);
|
||||
get => (Thickness) GetValue(BadgeMarginProperty);
|
||||
set => SetValue(BadgeMarginProperty, value);
|
||||
}
|
||||
|
||||
@@ -91,4 +91,4 @@ namespace HandyControl.Controls
|
||||
|
||||
protected override Geometry GetLayoutClip(Size layoutSlotSize) => null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public FrameworkElement Content
|
||||
{
|
||||
get => (FrameworkElement)GetValue(ContentProperty);
|
||||
get => (FrameworkElement) GetValue(ContentProperty);
|
||||
set => SetValue(ContentProperty, value);
|
||||
}
|
||||
|
||||
@@ -113,4 +113,4 @@ namespace HandyControl.Controls
|
||||
set => SetValue(ActualContentProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,4 +43,4 @@ namespace HandyControl.Controls
|
||||
ReadAction?.Invoke(Content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnClearPenCache(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var border = (DashedBorder)d;
|
||||
var border = (DashedBorder) d;
|
||||
border.LeftPenCache = null;
|
||||
border.RightPenCache = null;
|
||||
border.TopPenCache = null;
|
||||
@@ -302,9 +302,9 @@ namespace HandyControl.Controls
|
||||
var dpiScaleY = DpiHelper.DeviceDpiY;
|
||||
|
||||
borderThickness = new Thickness(
|
||||
DpiHelper.RoundLayoutValue(borderThickness.Left, dpiScaleX),
|
||||
DpiHelper.RoundLayoutValue(borderThickness.Left, dpiScaleX),
|
||||
DpiHelper.RoundLayoutValue(borderThickness.Top, dpiScaleY),
|
||||
DpiHelper.RoundLayoutValue(borderThickness.Right, dpiScaleX),
|
||||
DpiHelper.RoundLayoutValue(borderThickness.Right, dpiScaleX),
|
||||
DpiHelper.RoundLayoutValue(borderThickness.Bottom, dpiScaleY));
|
||||
}
|
||||
|
||||
@@ -667,4 +667,4 @@ namespace HandyControl.Controls
|
||||
internal readonly double LeftBottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -79,4 +79,4 @@ namespace HandyControl.Controls
|
||||
set => SetValue(LineStrokeDashArrayProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ namespace HandyControl.Controls
|
||||
private void Drawer_Unloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Loaded -= Drawer_Loaded;
|
||||
|
||||
|
||||
if (_maskElement != null)
|
||||
{
|
||||
_maskElement.PreviewMouseLeftButtonDown -= MaskElement_PreviewMouseLeftButtonDown;
|
||||
@@ -73,7 +73,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
private static void DataContextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) =>
|
||||
((Drawer)d).OnDataContextPropertyChanged(e);
|
||||
((Drawer) d).OnDataContextPropertyChanged(e);
|
||||
|
||||
private void OnDataContextPropertyChanged(DependencyPropertyChangedEventArgs e) => UpdateDataContext(_animationControl, e.OldValue, e.NewValue);
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace HandyControl.Controls
|
||||
private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (Drawer) d;
|
||||
ctl.OnIsOpenChanged((bool)e.NewValue);
|
||||
ctl.OnIsOpenChanged((bool) e.NewValue);
|
||||
}
|
||||
|
||||
public bool IsOpen
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public DependencyObject Target
|
||||
{
|
||||
get => (DependencyObject)GetValue(TargetProperty);
|
||||
get => (DependencyObject) GetValue(TargetProperty);
|
||||
set => SetValue(TargetProperty, value);
|
||||
}
|
||||
|
||||
@@ -97,4 +97,4 @@ namespace HandyControl.Controls
|
||||
_gotoTopAction?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
var ctl = (Gravatar) d;
|
||||
if (ctl.Source != null) return;
|
||||
ctl.Content = ctl.Generator.GetGravatar((string)e.NewValue);
|
||||
ctl.Content = ctl.Generator.GetGravatar((string) e.NewValue);
|
||||
}
|
||||
|
||||
public string Id
|
||||
@@ -37,7 +37,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (Gravatar)d;
|
||||
var ctl = (Gravatar) d;
|
||||
var v = (ImageSource) e.NewValue;
|
||||
|
||||
ctl.Background = v != null
|
||||
@@ -54,4 +54,4 @@ namespace HandyControl.Controls
|
||||
set => SetValue(SourceProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,11 +45,11 @@ namespace HandyControl.Controls
|
||||
public static readonly DependencyProperty ScaleProperty = DependencyProperty.Register(
|
||||
"Scale", typeof(double), typeof(Magnifier), new PropertyMetadata(5.0, OnScaleChanged), ValidateHelper.IsInRangeOfPosDouble);
|
||||
|
||||
private static void OnScaleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((Magnifier)d).UpdateViewboxSize();
|
||||
private static void OnScaleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((Magnifier) d).UpdateViewboxSize();
|
||||
|
||||
public double Scale
|
||||
{
|
||||
get => (double)GetValue(ScaleProperty);
|
||||
get => (double) GetValue(ScaleProperty);
|
||||
set => SetValue(ScaleProperty, value);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private void UpdateViewboxSize() => _viewboxSize = new Size(ActualWidth / Scale, ActualHeight / Scale);
|
||||
|
||||
protected sealed override void OnTargetChanged(FrameworkElement element , bool isNew)
|
||||
protected sealed override void OnTargetChanged(FrameworkElement element, bool isNew)
|
||||
{
|
||||
base.OnTargetChanged(element, isNew);
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
layer.Remove(_adornerContainer);
|
||||
}
|
||||
else if(_adornerContainer != null && _adornerContainer.Parent is AdornerLayer parent)
|
||||
else if (_adornerContainer != null && _adornerContainer.Parent is AdornerLayer parent)
|
||||
{
|
||||
parent.Remove(_adornerContainer);
|
||||
}
|
||||
|
||||
@@ -151,4 +151,4 @@ namespace HandyControl.Controls
|
||||
_timerClose.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,8 +69,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnVisibilityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (NotifyIcon)d;
|
||||
var v = (Visibility)e.NewValue;
|
||||
var ctl = (NotifyIcon) d;
|
||||
var v = (Visibility) e.NewValue;
|
||||
|
||||
if (v == Visibility.Visible)
|
||||
{
|
||||
@@ -97,7 +97,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void ContextMenuPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (NotifyIcon)d;
|
||||
var ctl = (NotifyIcon) d;
|
||||
ctl.OnContextMenuPropertyChanged(e);
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public string Token
|
||||
{
|
||||
get => (string)GetValue(TokenProperty);
|
||||
get => (string) GetValue(TokenProperty);
|
||||
set => SetValue(TokenProperty, value);
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public string Text
|
||||
{
|
||||
get => (string)GetValue(TextProperty);
|
||||
get => (string) GetValue(TextProperty);
|
||||
set => SetValue(TextProperty, value);
|
||||
}
|
||||
|
||||
@@ -267,8 +267,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (NotifyIcon)d;
|
||||
ctl._icon = (ImageSource)e.NewValue;
|
||||
var ctl = (NotifyIcon) d;
|
||||
ctl._icon = (ImageSource) e.NewValue;
|
||||
ctl.OnIconChanged();
|
||||
|
||||
if (!string.IsNullOrEmpty(ctl._windowClassName) && !ctl.IsBlink && ctl.Visibility == Visibility.Visible)
|
||||
@@ -279,7 +279,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public ImageSource Icon
|
||||
{
|
||||
get => (ImageSource)GetValue(IconProperty);
|
||||
get => (ImageSource) GetValue(IconProperty);
|
||||
set => SetValue(IconProperty, value);
|
||||
}
|
||||
|
||||
@@ -297,16 +297,16 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnBlinkIntervalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (NotifyIcon)d;
|
||||
var ctl = (NotifyIcon) d;
|
||||
if (ctl._dispatcherTimerBlink != null)
|
||||
{
|
||||
ctl._dispatcherTimerBlink.Interval = (TimeSpan)e.NewValue;
|
||||
ctl._dispatcherTimerBlink.Interval = (TimeSpan) e.NewValue;
|
||||
}
|
||||
}
|
||||
|
||||
public TimeSpan BlinkInterval
|
||||
{
|
||||
get => (TimeSpan)GetValue(BlinkIntervalProperty);
|
||||
get => (TimeSpan) GetValue(BlinkIntervalProperty);
|
||||
set => SetValue(BlinkIntervalProperty, value);
|
||||
}
|
||||
|
||||
@@ -315,9 +315,9 @@ namespace HandyControl.Controls
|
||||
|
||||
private static void OnIsBlinkChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (NotifyIcon)d;
|
||||
var ctl = (NotifyIcon) d;
|
||||
if (ctl.Visibility != Visibility.Visible) return;
|
||||
if ((bool)e.NewValue)
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
if (ctl._dispatcherTimerBlink == null)
|
||||
{
|
||||
@@ -339,7 +339,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsBlink
|
||||
{
|
||||
get => (bool)GetValue(IsBlinkProperty);
|
||||
get => (bool) GetValue(IsBlinkProperty);
|
||||
set => SetValue(IsBlinkProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -355,10 +355,10 @@ namespace HandyControl.Controls
|
||||
if (!isTrue) return false;
|
||||
|
||||
InteropMethods.GetCursorPos(out var point);
|
||||
return rectNotifyList.Any(rectNotify =>
|
||||
point.X >= rectNotify.Left &&
|
||||
point.X <= rectNotify.Right &&
|
||||
point.Y >= rectNotify.Top &&
|
||||
return rectNotifyList.Any(rectNotify =>
|
||||
point.X >= rectNotify.Left &&
|
||||
point.X <= rectNotify.Right &&
|
||||
point.Y >= rectNotify.Top &&
|
||||
point.Y <= rectNotify.Bottom);
|
||||
}
|
||||
|
||||
@@ -436,7 +436,7 @@ namespace HandyControl.Controls
|
||||
private bool FindNotifyIcon(IntPtr hTrayWnd, ref List<InteropValues.RECT> rectNotifyList)
|
||||
{
|
||||
InteropMethods.GetWindowRect(hTrayWnd, out var rectTray);
|
||||
var count = (int)InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_BUTTONCOUNT, 0, IntPtr.Zero);
|
||||
var count = (int) InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_BUTTONCOUNT, 0, IntPtr.Zero);
|
||||
|
||||
var isFind = false;
|
||||
if (count > 0)
|
||||
@@ -454,20 +454,20 @@ namespace HandyControl.Controls
|
||||
InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_GETBUTTON, i, address);
|
||||
var isTrue = InteropMethods.ReadProcessMemory(hProcess, address, out btnData, Marshal.SizeOf(btnData), out _);
|
||||
if (!isTrue) continue;
|
||||
|
||||
|
||||
if (btnData.dwData == IntPtr.Zero)
|
||||
{
|
||||
btnData.dwData = btnData.iString;
|
||||
}
|
||||
|
||||
|
||||
InteropMethods.ReadProcessMemory(hProcess, btnData.dwData, out trayData, Marshal.SizeOf(trayData), out _);
|
||||
InteropMethods.GetWindowThreadProcessId(trayData.hwnd, out var dwProcessId);
|
||||
|
||||
if (dwProcessId == (uint)handle)
|
||||
if (dwProcessId == (uint) handle)
|
||||
{
|
||||
var rect = new InteropValues.RECT();
|
||||
var lngRect = InteropMethods.VirtualAllocEx(hProcess, IntPtr.Zero, Marshal.SizeOf(typeof(Rect)), InteropValues.AllocationType.Commit, InteropValues.MemoryProtection.ReadWrite);
|
||||
|
||||
|
||||
InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_GETITEMRECT, i, lngRect);
|
||||
InteropMethods.ReadProcessMemory(hProcess, lngRect, out rect, Marshal.SizeOf(rect), out _);
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace HandyControl.Controls
|
||||
}, (o, value) =>
|
||||
{
|
||||
if (!(o is Pagination)) return 1;
|
||||
var intValue = (int)value;
|
||||
var intValue = (int) value;
|
||||
if (intValue < 1)
|
||||
{
|
||||
return 1;
|
||||
@@ -115,7 +115,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public int MaxPageCount
|
||||
{
|
||||
get => (int)GetValue(MaxPageCountProperty);
|
||||
get => (int) GetValue(MaxPageCountProperty);
|
||||
set => SetValue(MaxPageCountProperty, value);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace HandyControl.Controls
|
||||
}, (o, value) =>
|
||||
{
|
||||
if (!(o is Pagination)) return 1;
|
||||
var intValue = (int)value;
|
||||
var intValue = (int) value;
|
||||
if (intValue < 1)
|
||||
{
|
||||
return 1;
|
||||
@@ -149,7 +149,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public int DataCountPerPage
|
||||
{
|
||||
get => (int)GetValue(DataCountPerPageProperty);
|
||||
get => (int) GetValue(DataCountPerPageProperty);
|
||||
set => SetValue(DataCountPerPageProperty, value);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace HandyControl.Controls
|
||||
}, (o, value) =>
|
||||
{
|
||||
if (!(o is Pagination pagination)) return 1;
|
||||
var intValue = (int)value;
|
||||
var intValue = (int) value;
|
||||
if (intValue < 0)
|
||||
{
|
||||
return 0;
|
||||
@@ -188,7 +188,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public int PageIndex
|
||||
{
|
||||
get => (int)GetValue(PageIndexProperty);
|
||||
get => (int) GetValue(PageIndexProperty);
|
||||
set => SetValue(PageIndexProperty, value);
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}), value =>
|
||||
{
|
||||
var intValue = (int)value;
|
||||
var intValue = (int) value;
|
||||
return intValue >= 0;
|
||||
});
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public int MaxPageInterval
|
||||
{
|
||||
get => (int)GetValue(MaxPageIntervalProperty);
|
||||
get => (int) GetValue(MaxPageIntervalProperty);
|
||||
set => SetValue(MaxPageIntervalProperty, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace HandyControl.Controls
|
||||
Child = this
|
||||
};
|
||||
|
||||
_popup.SetBinding(DataContextProperty, new Binding(DataContextProperty.Name) {Source = this});
|
||||
_popup.SetBinding(DataContextProperty, new Binding(DataContextProperty.Name) { Source = this });
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty HitModeProperty = DependencyProperty.RegisterAttached(
|
||||
@@ -35,7 +35,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public HitMode HitMode
|
||||
{
|
||||
get => (HitMode)GetValue(HitModeProperty);
|
||||
get => (HitMode) GetValue(HitModeProperty);
|
||||
set => SetValue(HitModeProperty, value);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public DataTemplate ContentTemplate
|
||||
{
|
||||
get => (DataTemplate)GetValue(ContentTemplateProperty);
|
||||
get => (DataTemplate) GetValue(ContentTemplateProperty);
|
||||
set => SetValue(ContentTemplateProperty, value);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public string ContentStringFormat
|
||||
{
|
||||
get => (string)GetValue(ContentStringFormatProperty);
|
||||
get => (string) GetValue(ContentStringFormatProperty);
|
||||
set => SetValue(ContentStringFormatProperty, value);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public DataTemplateSelector ContentTemplateSelector
|
||||
{
|
||||
get => (DataTemplateSelector)GetValue(ContentTemplateSelectorProperty);
|
||||
get => (DataTemplateSelector) GetValue(ContentTemplateSelectorProperty);
|
||||
set => SetValue(ContentTemplateSelectorProperty, value);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double Offset
|
||||
{
|
||||
get => (double)GetValue(OffsetProperty);
|
||||
get => (double) GetValue(OffsetProperty);
|
||||
set => SetValue(OffsetProperty, value);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public PlacementType PlacementType
|
||||
{
|
||||
get => (PlacementType)GetValue(PlacementTypeProperty);
|
||||
get => (PlacementType) GetValue(PlacementTypeProperty);
|
||||
set => SetValue(PlacementTypeProperty, value);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
else
|
||||
{
|
||||
((Poptip)GetInstance(d))?.SwitchPoptip((bool)e.NewValue);
|
||||
((Poptip) GetInstance(d))?.SwitchPoptip((bool) e.NewValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace HandyControl.Controls
|
||||
var offsetX = .0;
|
||||
var offsetY = .0;
|
||||
|
||||
var poptip = (Poptip)GetInstance(Target);
|
||||
var poptip = (Poptip) GetInstance(Target);
|
||||
var popupPlacement = poptip.PlacementType;
|
||||
var popupOffset = poptip.Offset;
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static void SetIsInertiaEnabled(DependencyObject element, bool value) => element.SetValue(IsInertiaEnabledProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
public static bool GetIsInertiaEnabled(DependencyObject element) => (bool)element.GetValue(IsInertiaEnabledProperty);
|
||||
public static bool GetIsInertiaEnabled(DependencyObject element) => (bool) element.GetValue(IsInertiaEnabledProperty);
|
||||
|
||||
/// <summary>
|
||||
/// 是否支持惯性
|
||||
@@ -224,4 +224,4 @@ namespace HandyControl.Controls
|
||||
set => SetValue(CurrentHorizontalOffsetProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,4 +35,4 @@ namespace HandyControl.Controls
|
||||
set => SetValue(ColorProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
_isLeftButtonPressed = true;
|
||||
}
|
||||
else if(_isLeftButtonPressed)
|
||||
else if (_isLeftButtonPressed)
|
||||
{
|
||||
if (Left < 0)
|
||||
{
|
||||
@@ -61,4 +61,4 @@ namespace HandyControl.Controls
|
||||
return sprite;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ namespace HandyControl.Controls
|
||||
Background = Brushes.Transparent,
|
||||
Padding = MarkMargin,
|
||||
Child = presenter
|
||||
}),
|
||||
}),
|
||||
Geometry = new RectangleGeometry(new Rect(markSize))
|
||||
},
|
||||
Viewport = new Rect(markSize)
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace HandyControl.Controls
|
||||
var centerX = element.DesiredSize.Width / 2.0;
|
||||
var centerY = element.DesiredSize.Height / 2.0;
|
||||
var angle = perDeg * i++ + offsetAngle;
|
||||
|
||||
|
||||
var transform = new RotateTransform
|
||||
{
|
||||
CenterX = centerX,
|
||||
@@ -73,18 +73,18 @@ namespace HandyControl.Controls
|
||||
Angle = keepVertical ? 0 : angle
|
||||
};
|
||||
element.RenderTransform = transform;
|
||||
|
||||
|
||||
var r = Math.PI * angle / 180.0;
|
||||
var x = radius * Math.Cos(r);
|
||||
var y = radius * Math.Sin(r);
|
||||
|
||||
|
||||
var rectX = x + finalSize.Width / 2 - centerX;
|
||||
var rectY = y + finalSize.Height / 2 - centerY;
|
||||
|
||||
|
||||
element.Arrange(new Rect(rectX, rectY, element.DesiredSize.Width, element.DesiredSize.Height));
|
||||
}
|
||||
|
||||
return finalSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace HandyControl.Controls
|
||||
=> element.SetValue(OrderProperty, value);
|
||||
|
||||
public static int GetOrder(DependencyObject element)
|
||||
=> (int)element.GetValue(OrderProperty);
|
||||
=> (int) element.GetValue(OrderProperty);
|
||||
|
||||
public static readonly DependencyProperty FlexGrowProperty = DependencyProperty.RegisterAttached(
|
||||
"FlexGrow", typeof(double), typeof(FlexPanel),
|
||||
@@ -39,7 +39,7 @@ namespace HandyControl.Controls
|
||||
=> element.SetValue(FlexGrowProperty, value);
|
||||
|
||||
public static double GetFlexGrow(DependencyObject element)
|
||||
=> (double)element.GetValue(FlexGrowProperty);
|
||||
=> (double) element.GetValue(FlexGrowProperty);
|
||||
|
||||
public static readonly DependencyProperty FlexShrinkProperty = DependencyProperty.RegisterAttached(
|
||||
"FlexShrink", typeof(double), typeof(FlexPanel),
|
||||
@@ -50,7 +50,7 @@ namespace HandyControl.Controls
|
||||
=> element.SetValue(FlexShrinkProperty, value);
|
||||
|
||||
public static double GetFlexShrink(DependencyObject element)
|
||||
=> (double)element.GetValue(FlexShrinkProperty);
|
||||
=> (double) element.GetValue(FlexShrinkProperty);
|
||||
|
||||
public static readonly DependencyProperty FlexBasisProperty = DependencyProperty.RegisterAttached(
|
||||
"FlexBasis", typeof(double), typeof(FlexPanel),
|
||||
@@ -60,7 +60,7 @@ namespace HandyControl.Controls
|
||||
=> element.SetValue(FlexBasisProperty, value);
|
||||
|
||||
public static double GetFlexBasis(DependencyObject element)
|
||||
=> (double)element.GetValue(FlexBasisProperty);
|
||||
=> (double) element.GetValue(FlexBasisProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignSelfProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignSelf", typeof(FlexItemAlignment), typeof(FlexPanel),
|
||||
@@ -74,7 +74,7 @@ namespace HandyControl.Controls
|
||||
#region Panel
|
||||
|
||||
public static FlexItemAlignment GetAlignSelf(DependencyObject element)
|
||||
=> (FlexItemAlignment)element.GetValue(AlignSelfProperty);
|
||||
=> (FlexItemAlignment) element.GetValue(AlignSelfProperty);
|
||||
|
||||
public static readonly DependencyProperty FlexDirectionProperty = DependencyProperty.Register(
|
||||
"FlexDirection", typeof(FlexDirection), typeof(FlexPanel),
|
||||
@@ -82,7 +82,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public FlexDirection FlexDirection
|
||||
{
|
||||
get => (FlexDirection)GetValue(FlexDirectionProperty);
|
||||
get => (FlexDirection) GetValue(FlexDirectionProperty);
|
||||
set => SetValue(FlexDirectionProperty, value);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public FlexWrap FlexWrap
|
||||
{
|
||||
get => (FlexWrap)GetValue(FlexWrapProperty);
|
||||
get => (FlexWrap) GetValue(FlexWrapProperty);
|
||||
set => SetValue(FlexWrapProperty, value);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public FlexContentJustify JustifyContent
|
||||
{
|
||||
get => (FlexContentJustify)GetValue(JustifyContentProperty);
|
||||
get => (FlexContentJustify) GetValue(JustifyContentProperty);
|
||||
set => SetValue(JustifyContentProperty, value);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public FlexItemsAlignment AlignItems
|
||||
{
|
||||
get => (FlexItemsAlignment)GetValue(AlignItemsProperty);
|
||||
get => (FlexItemsAlignment) GetValue(AlignItemsProperty);
|
||||
set => SetValue(AlignItemsProperty, value);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public FlexContentAlignment AlignContent
|
||||
{
|
||||
get => (FlexContentAlignment)GetValue(AlignContentProperty);
|
||||
get => (FlexContentAlignment) GetValue(AlignContentProperty);
|
||||
set => SetValue(AlignContentProperty, value);
|
||||
}
|
||||
|
||||
@@ -604,7 +604,7 @@ namespace HandyControl.Controls
|
||||
|
||||
var v = lineInfo.OffsetV;
|
||||
var alignSelf = GetAlignSelf(child);
|
||||
var alignment = alignSelf == FlexItemAlignment.Auto ? alignItems : (FlexItemsAlignment)alignSelf;
|
||||
var alignment = alignSelf == FlexItemAlignment.Auto ? alignItems : (FlexItemsAlignment) alignSelf;
|
||||
|
||||
switch (alignment)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public ColLayout Layout
|
||||
{
|
||||
get => (ColLayout)GetValue(LayoutProperty);
|
||||
get => (ColLayout) GetValue(LayoutProperty);
|
||||
set => SetValue(LayoutProperty, value);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public int Offset
|
||||
{
|
||||
get => (int)GetValue(OffsetProperty);
|
||||
get => (int) GetValue(OffsetProperty);
|
||||
set => SetValue(OffsetProperty, value);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private static bool OnSpanValidate(object value)
|
||||
{
|
||||
var v = (int)value;
|
||||
var v = (int) value;
|
||||
return v >= 1 && v <= 24;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using HandyControl.Tools.Extension;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools;
|
||||
using HandyControl.Tools.Extension;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
@@ -22,7 +22,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public double Gutter
|
||||
{
|
||||
get => (double)GetValue(GutterProperty);
|
||||
get => (double) GetValue(GutterProperty);
|
||||
set => SetValue(GutterProperty, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
|
||||
|
||||
count -= 1;
|
||||
|
||||
var index = (int)Math.Floor(Math.Pow(count / 3.0 + 0.25, 0.5) - 0.5);
|
||||
var index = (int) Math.Floor(Math.Pow(count / 3.0 + 0.25, 0.5) - 0.5);
|
||||
var valeIndex = 3 * index * index + 3 * index;
|
||||
|
||||
return count > valeIndex
|
||||
@@ -163,4 +163,4 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ namespace HandyControl.Controls
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static UIElement GetLeftOf(DependencyObject element)
|
||||
=> (UIElement)element.GetValue(LeftOfProperty);
|
||||
=> (UIElement) element.GetValue(LeftOfProperty);
|
||||
|
||||
public static readonly DependencyProperty AboveProperty = DependencyProperty.RegisterAttached(
|
||||
"Above", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
@@ -122,7 +122,7 @@ namespace HandyControl.Controls
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static UIElement GetAbove(DependencyObject element)
|
||||
=> (UIElement)element.GetValue(AboveProperty);
|
||||
=> (UIElement) element.GetValue(AboveProperty);
|
||||
|
||||
public static readonly DependencyProperty RightOfProperty = DependencyProperty.RegisterAttached(
|
||||
"RightOf", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
@@ -132,7 +132,7 @@ namespace HandyControl.Controls
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static UIElement GetRightOf(DependencyObject element)
|
||||
=> (UIElement)element.GetValue(RightOfProperty);
|
||||
=> (UIElement) element.GetValue(RightOfProperty);
|
||||
|
||||
public static readonly DependencyProperty BelowProperty = DependencyProperty.RegisterAttached(
|
||||
"Below", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
@@ -155,7 +155,7 @@ namespace HandyControl.Controls
|
||||
=> element.SetValue(AlignHorizontalCenterWithPanelProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
public static bool GetAlignHorizontalCenterWithPanel(DependencyObject element)
|
||||
=> (bool)element.GetValue(AlignHorizontalCenterWithPanelProperty);
|
||||
=> (bool) element.GetValue(AlignHorizontalCenterWithPanelProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignVerticalCenterWithPanelProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignVerticalCenterWithPanel", typeof(bool), typeof(RelativePanel), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
@@ -164,7 +164,7 @@ namespace HandyControl.Controls
|
||||
=> element.SetValue(AlignVerticalCenterWithPanelProperty, ValueBoxes.BooleanBox(value));
|
||||
|
||||
public static bool GetAlignVerticalCenterWithPanel(DependencyObject element)
|
||||
=> (bool)element.GetValue(AlignVerticalCenterWithPanelProperty);
|
||||
=> (bool) element.GetValue(AlignVerticalCenterWithPanelProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignHorizontalCenterWithProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignHorizontalCenterWith", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
@@ -174,7 +174,7 @@ namespace HandyControl.Controls
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static UIElement GetAlignHorizontalCenterWith(DependencyObject element)
|
||||
=> (UIElement)element.GetValue(AlignHorizontalCenterWithProperty);
|
||||
=> (UIElement) element.GetValue(AlignHorizontalCenterWithProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignVerticalCenterWithProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignVerticalCenterWith", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
@@ -184,7 +184,7 @@ namespace HandyControl.Controls
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static UIElement GetAlignVerticalCenterWith(DependencyObject element)
|
||||
=> (UIElement)element.GetValue(AlignVerticalCenterWithProperty);
|
||||
=> (UIElement) element.GetValue(AlignVerticalCenterWithProperty);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (node.Measured || !node.OutgoingNodes.Any())
|
||||
{
|
||||
if (prevNode.LeftOfNode != null && prevNode.LeftOfNode == node ||
|
||||
if (prevNode.LeftOfNode != null && prevNode.LeftOfNode == node ||
|
||||
prevNode.RightOfNode != null && prevNode.RightOfNode == node)
|
||||
{
|
||||
prevSize.Width += node.BoundingSize.Width;
|
||||
@@ -681,4 +681,4 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,4 +39,4 @@ namespace HandyControl.Controls
|
||||
return arrangeSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace HandyControl.Controls
|
||||
set => SetValue(GroupsProperty, value);
|
||||
}
|
||||
|
||||
private static bool IsGroupsValid(object value) => (int)value >= 1;
|
||||
private static bool IsGroupsValid(object value) => (int) value >= 1;
|
||||
|
||||
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
|
||||
"Orientation", typeof(Orientation), typeof(WaterfallPanel), new FrameworkPropertyMetadata(
|
||||
@@ -27,7 +27,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
get => (Orientation) GetValue(OrientationProperty);
|
||||
set => SetValue(OrientationProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
protected override Size MeasureOverride(Size constraint)
|
||||
{
|
||||
@@ -81,4 +81,4 @@ namespace HandyControl.Controls
|
||||
return panelSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool IsIndeterminate
|
||||
{
|
||||
get => (bool)GetValue(IsIndeterminateProperty);
|
||||
get => (bool) GetValue(IsIndeterminateProperty);
|
||||
set => SetValue(IsIndeterminateProperty, value);
|
||||
}
|
||||
|
||||
@@ -99,4 +99,4 @@ namespace HandyControl.Controls
|
||||
SetProgressBarIndicatorAngle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ namespace HandyControl.Controls
|
||||
_translateTransformYRange = clipElement.Height - TranslateTransformMinY;
|
||||
_waveElement.RenderTransform = new TransformGroup
|
||||
{
|
||||
Children = {_translateTransform}
|
||||
Children = { _translateTransform }
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public string Text
|
||||
{
|
||||
get => (string)GetValue(TextProperty);
|
||||
get => (string) GetValue(TextProperty);
|
||||
set => SetValue(TextProperty, value);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public bool ShowText
|
||||
{
|
||||
get => (bool)GetValue(ShowTextProperty);
|
||||
get => (bool) GetValue(ShowTextProperty);
|
||||
set => SetValue(ShowTextProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
@@ -116,4 +116,4 @@ namespace HandyControl.Controls
|
||||
set => SetValue(WaveStrokeProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,4 +11,4 @@ namespace HandyControl.Controls
|
||||
|
||||
public override DependencyProperty GetDependencyProperty() => System.Windows.Controls.DatePicker.SelectedDateProperty;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -11,4 +11,4 @@ namespace HandyControl.Controls
|
||||
|
||||
public override DependencyProperty GetDependencyProperty() => DateTimePicker.SelectedDateTimeProperty;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,4 +14,4 @@ namespace HandyControl.Controls
|
||||
|
||||
public override DependencyProperty GetDependencyProperty() => Selector.SelectedValueProperty;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -68,4 +68,4 @@ namespace HandyControl.Controls
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,8 @@ namespace HandyControl.Controls
|
||||
internal static readonly DependencyProperty UriProperty = DependencyProperty.Register(
|
||||
"Uri", typeof(Uri), typeof(ImagePropertyEditor), new PropertyMetadata(default(Uri), OnUriChangedCallback));
|
||||
|
||||
private static void OnUriChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) =>
|
||||
((ImagePropertyEditor)d).Source = e.NewValue is Uri uri ? BitmapFrame.Create(uri) : null;
|
||||
private static void OnUriChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) =>
|
||||
((ImagePropertyEditor) d).Source = e.NewValue is Uri uri ? BitmapFrame.Create(uri) : null;
|
||||
|
||||
internal Uri Uri
|
||||
{
|
||||
@@ -60,4 +60,4 @@ namespace HandyControl.Controls
|
||||
|
||||
public override DependencyProperty GetDependencyProperty() => SourceProperty;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -6,7 +6,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public NumberPropertyEditor()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public NumberPropertyEditor(double minimum, double maximum)
|
||||
@@ -28,4 +28,4 @@ namespace HandyControl.Controls
|
||||
|
||||
public override DependencyProperty GetDependencyProperty() => NumericUpDown.ValueProperty;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -11,4 +11,4 @@ namespace HandyControl.Controls
|
||||
|
||||
public override DependencyProperty GetDependencyProperty() => System.Windows.Controls.TextBox.TextProperty;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 403 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user