Automated dotnet-format update

This commit is contained in:
github-actions-dotnet-formatter[bot] committed 2020-12-04 15:12:55 +00:00
1 parent ad4c2f68aa
commit 2af18c2d38
165 files changed
+1053 -1051

No files matched your search

@@ -1,8 +1,8 @@
namespace HandyControlDemo.Data
{
public class MessageToken
public class MessageToken
{
public static readonly string LoadShowContent = nameof(LoadShowContent);
public static readonly string LoadShowContent = nameof(LoadShowContent);
public static readonly string FullSwitch = nameof(FullSwitch);
@@ -35,224 +35,224 @@ namespace HandyControlDemo.Properties.Langs
Mode = BindingMode.OneWay
});
private void UpdateLangs()
private void UpdateLangs()
{
OnPropertyChanged(nameof(About));
OnPropertyChanged(nameof(AddItem));
OnPropertyChanged(nameof(AnimationPath));
OnPropertyChanged(nameof(AppClosingTip));
OnPropertyChanged(nameof(Ask));
OnPropertyChanged(nameof(Badge));
OnPropertyChanged(nameof(BasicInfo));
OnPropertyChanged(nameof(BasicLayout));
OnPropertyChanged(nameof(Blink));
OnPropertyChanged(nameof(Blog));
OnPropertyChanged(nameof(Border));
OnPropertyChanged(nameof(Brush));
OnPropertyChanged(nameof(Button));
OnPropertyChanged(nameof(ButtonCustom));
OnPropertyChanged(nameof(ButtonGroup));
OnPropertyChanged(nameof(Calendar));
OnPropertyChanged(nameof(CalendarWithClock));
OnPropertyChanged(nameof(Card));
OnPropertyChanged(nameof(Carousel));
OnPropertyChanged(nameof(ChangeLangAsk));
OnPropertyChanged(nameof(ChatBubble));
OnPropertyChanged(nameof(Chatroom));
OnPropertyChanged(nameof(CheckBox));
OnPropertyChanged(nameof(About));
OnPropertyChanged(nameof(AddItem));
OnPropertyChanged(nameof(AnimationPath));
OnPropertyChanged(nameof(AppClosingTip));
OnPropertyChanged(nameof(Ask));
OnPropertyChanged(nameof(Badge));
OnPropertyChanged(nameof(BasicInfo));
OnPropertyChanged(nameof(BasicLayout));
OnPropertyChanged(nameof(Blink));
OnPropertyChanged(nameof(Blog));
OnPropertyChanged(nameof(Border));
OnPropertyChanged(nameof(Brush));
OnPropertyChanged(nameof(Button));
OnPropertyChanged(nameof(ButtonCustom));
OnPropertyChanged(nameof(ButtonGroup));
OnPropertyChanged(nameof(Calendar));
OnPropertyChanged(nameof(CalendarWithClock));
OnPropertyChanged(nameof(Card));
OnPropertyChanged(nameof(Carousel));
OnPropertyChanged(nameof(ChangeLangAsk));
OnPropertyChanged(nameof(ChatBubble));
OnPropertyChanged(nameof(Chatroom));
OnPropertyChanged(nameof(CheckBox));
OnPropertyChanged(nameof(CheckComboBox));
OnPropertyChanged(nameof(CirclePanel));
OnPropertyChanged(nameof(Clear));
OnPropertyChanged(nameof(Click2Count));
OnPropertyChanged(nameof(Clock));
OnPropertyChanged(nameof(ColorPicker));
OnPropertyChanged(nameof(ColumnOffset));
OnPropertyChanged(nameof(ColumnSpacing));
OnPropertyChanged(nameof(ComboBox));
OnPropertyChanged(nameof(ComingSoon));
OnPropertyChanged(nameof(Comment));
OnPropertyChanged(nameof(Common));
OnPropertyChanged(nameof(CompareSlider));
OnPropertyChanged(nameof(Complete));
OnPropertyChanged(nameof(ContentDemoStr));
OnPropertyChanged(nameof(Contributors));
OnPropertyChanged(nameof(Controls));
OnPropertyChanged(nameof(CoverFlow));
OnPropertyChanged(nameof(CoverView));
OnPropertyChanged(nameof(Danger));
OnPropertyChanged(nameof(DataGrid));
OnPropertyChanged(nameof(DatePicker));
OnPropertyChanged(nameof(DateTimePicker));
OnPropertyChanged(nameof(Default));
OnPropertyChanged(nameof(Demo));
OnPropertyChanged(nameof(Dialog));
OnPropertyChanged(nameof(DialogDemo));
OnPropertyChanged(nameof(Divider));
OnPropertyChanged(nameof(Doc_cn));
OnPropertyChanged(nameof(Doc_en));
OnPropertyChanged(nameof(Documentation));
OnPropertyChanged(nameof(DragHere));
OnPropertyChanged(nameof(Drawer));
OnPropertyChanged(nameof(Effects));
OnPropertyChanged(nameof(Email));
OnPropertyChanged(nameof(Error));
OnPropertyChanged(nameof(Exit));
OnPropertyChanged(nameof(Expander));
OnPropertyChanged(nameof(Fatal));
OnPropertyChanged(nameof(Clear));
OnPropertyChanged(nameof(Click2Count));
OnPropertyChanged(nameof(Clock));
OnPropertyChanged(nameof(ColorPicker));
OnPropertyChanged(nameof(ColumnOffset));
OnPropertyChanged(nameof(ColumnSpacing));
OnPropertyChanged(nameof(ComboBox));
OnPropertyChanged(nameof(ComingSoon));
OnPropertyChanged(nameof(Comment));
OnPropertyChanged(nameof(Common));
OnPropertyChanged(nameof(CompareSlider));
OnPropertyChanged(nameof(Complete));
OnPropertyChanged(nameof(ContentDemoStr));
OnPropertyChanged(nameof(Contributors));
OnPropertyChanged(nameof(Controls));
OnPropertyChanged(nameof(CoverFlow));
OnPropertyChanged(nameof(CoverView));
OnPropertyChanged(nameof(Danger));
OnPropertyChanged(nameof(DataGrid));
OnPropertyChanged(nameof(DatePicker));
OnPropertyChanged(nameof(DateTimePicker));
OnPropertyChanged(nameof(Default));
OnPropertyChanged(nameof(Demo));
OnPropertyChanged(nameof(Dialog));
OnPropertyChanged(nameof(DialogDemo));
OnPropertyChanged(nameof(Divider));
OnPropertyChanged(nameof(Doc_cn));
OnPropertyChanged(nameof(Doc_en));
OnPropertyChanged(nameof(Documentation));
OnPropertyChanged(nameof(DragHere));
OnPropertyChanged(nameof(Drawer));
OnPropertyChanged(nameof(Effects));
OnPropertyChanged(nameof(Email));
OnPropertyChanged(nameof(Error));
OnPropertyChanged(nameof(Exit));
OnPropertyChanged(nameof(Expander));
OnPropertyChanged(nameof(Fatal));
OnPropertyChanged(nameof(FlexPanel));
OnPropertyChanged(nameof(FlipClock));
OnPropertyChanged(nameof(FloatingBlock));
OnPropertyChanged(nameof(FlowDocument));
OnPropertyChanged(nameof(FlowDocumentPageViewer));
OnPropertyChanged(nameof(FlowDocumentReader));
OnPropertyChanged(nameof(FlowDocumentScrollViewer));
OnPropertyChanged(nameof(Frame));
OnPropertyChanged(nameof(Geometry));
OnPropertyChanged(nameof(GifImage));
OnPropertyChanged(nameof(GotoTop));
OnPropertyChanged(nameof(Gravatar));
OnPropertyChanged(nameof(Grid));
OnPropertyChanged(nameof(GroupBox));
OnPropertyChanged(nameof(Groups));
OnPropertyChanged(nameof(Growl));
OnPropertyChanged(nameof(GrowlAsk));
OnPropertyChanged(nameof(GrowlDemo));
OnPropertyChanged(nameof(GrowlError));
OnPropertyChanged(nameof(GrowlFatal));
OnPropertyChanged(nameof(GrowlInfo));
OnPropertyChanged(nameof(GrowlSuccess));
OnPropertyChanged(nameof(GrowlWarning));
OnPropertyChanged(nameof(HatchBrushGenerator));
OnPropertyChanged(nameof(HoneycombPanel));
OnPropertyChanged(nameof(HybridLayout));
OnPropertyChanged(nameof(Ignore));
OnPropertyChanged(nameof(ImageBlock));
OnPropertyChanged(nameof(ImageBrowser));
OnPropertyChanged(nameof(FloatingBlock));
OnPropertyChanged(nameof(FlowDocument));
OnPropertyChanged(nameof(FlowDocumentPageViewer));
OnPropertyChanged(nameof(FlowDocumentReader));
OnPropertyChanged(nameof(FlowDocumentScrollViewer));
OnPropertyChanged(nameof(Frame));
OnPropertyChanged(nameof(Geometry));
OnPropertyChanged(nameof(GifImage));
OnPropertyChanged(nameof(GotoTop));
OnPropertyChanged(nameof(Gravatar));
OnPropertyChanged(nameof(Grid));
OnPropertyChanged(nameof(GroupBox));
OnPropertyChanged(nameof(Groups));
OnPropertyChanged(nameof(Growl));
OnPropertyChanged(nameof(GrowlAsk));
OnPropertyChanged(nameof(GrowlDemo));
OnPropertyChanged(nameof(GrowlError));
OnPropertyChanged(nameof(GrowlFatal));
OnPropertyChanged(nameof(GrowlInfo));
OnPropertyChanged(nameof(GrowlSuccess));
OnPropertyChanged(nameof(GrowlWarning));
OnPropertyChanged(nameof(HatchBrushGenerator));
OnPropertyChanged(nameof(HoneycombPanel));
OnPropertyChanged(nameof(HybridLayout));
OnPropertyChanged(nameof(Ignore));
OnPropertyChanged(nameof(ImageBlock));
OnPropertyChanged(nameof(ImageBrowser));
OnPropertyChanged(nameof(ImageSelector));
OnPropertyChanged(nameof(Index));
OnPropertyChanged(nameof(Info));
OnPropertyChanged(nameof(InteractiveDialog));
OnPropertyChanged(nameof(IsNotPhone));
OnPropertyChanged(nameof(Label));
OnPropertyChanged(nameof(LangComment));
OnPropertyChanged(nameof(ListBox));
OnPropertyChanged(nameof(ListView));
OnPropertyChanged(nameof(Loading));
OnPropertyChanged(nameof(Magnifier));
OnPropertyChanged(nameof(Menu));
OnPropertyChanged(nameof(MessageBox));
OnPropertyChanged(nameof(Morphing_Animation));
OnPropertyChanged(nameof(Name));
OnPropertyChanged(nameof(NewWindow));
OnPropertyChanged(nameof(Next));
OnPropertyChanged(nameof(Notification));
OnPropertyChanged(nameof(NotifyIcon));
OnPropertyChanged(nameof(NumericUpDown));
OnPropertyChanged(nameof(Off));
OnPropertyChanged(nameof(Ok));
OnPropertyChanged(nameof(On));
OnPropertyChanged(nameof(OpenBlurWindow));
OnPropertyChanged(nameof(OpenCommonWindow));
OnPropertyChanged(nameof(OpenCustomContentWindow));
OnPropertyChanged(nameof(OpenCustomMessageWindow));
OnPropertyChanged(nameof(OpenCustomNonClientAreaWindow));
OnPropertyChanged(nameof(OpenGlowWindow));
OnPropertyChanged(nameof(OpenImageBrowser));
OnPropertyChanged(nameof(OpenMessageWindow));
OnPropertyChanged(nameof(OpenMouseFollowWindow));
OnPropertyChanged(nameof(OpenNativeCommonWindow));
OnPropertyChanged(nameof(OpenNavigationWindow));
OnPropertyChanged(nameof(OpenNoNonClientAreaDragableWindow));
OnPropertyChanged(nameof(OpenPanel));
OnPropertyChanged(nameof(OpenSprite));
OnPropertyChanged(nameof(OutlineText));
OnPropertyChanged(nameof(Pagination));
OnPropertyChanged(nameof(PasswordBox));
OnPropertyChanged(nameof(PinBox));
OnPropertyChanged(nameof(PleaseInput));
OnPropertyChanged(nameof(PleaseWait));
OnPropertyChanged(nameof(PlsEnterContent));
OnPropertyChanged(nameof(PlsEnterEmail));
OnPropertyChanged(nameof(PlsEnterKey));
OnPropertyChanged(nameof(Poptip));
OnPropertyChanged(nameof(PoptipPositionStr));
OnPropertyChanged(nameof(PracticalDemos));
OnPropertyChanged(nameof(Prev));
OnPropertyChanged(nameof(PreviewSlider));
OnPropertyChanged(nameof(Primary));
OnPropertyChanged(nameof(ProgressBar));
OnPropertyChanged(nameof(ProgressButton));
OnPropertyChanged(nameof(Project));
OnPropertyChanged(nameof(Info));
OnPropertyChanged(nameof(InteractiveDialog));
OnPropertyChanged(nameof(IsNotPhone));
OnPropertyChanged(nameof(Label));
OnPropertyChanged(nameof(LangComment));
OnPropertyChanged(nameof(ListBox));
OnPropertyChanged(nameof(ListView));
OnPropertyChanged(nameof(Loading));
OnPropertyChanged(nameof(Magnifier));
OnPropertyChanged(nameof(Menu));
OnPropertyChanged(nameof(MessageBox));
OnPropertyChanged(nameof(Morphing_Animation));
OnPropertyChanged(nameof(Name));
OnPropertyChanged(nameof(NewWindow));
OnPropertyChanged(nameof(Next));
OnPropertyChanged(nameof(Notification));
OnPropertyChanged(nameof(NotifyIcon));
OnPropertyChanged(nameof(NumericUpDown));
OnPropertyChanged(nameof(Off));
OnPropertyChanged(nameof(Ok));
OnPropertyChanged(nameof(On));
OnPropertyChanged(nameof(OpenBlurWindow));
OnPropertyChanged(nameof(OpenCommonWindow));
OnPropertyChanged(nameof(OpenCustomContentWindow));
OnPropertyChanged(nameof(OpenCustomMessageWindow));
OnPropertyChanged(nameof(OpenCustomNonClientAreaWindow));
OnPropertyChanged(nameof(OpenGlowWindow));
OnPropertyChanged(nameof(OpenImageBrowser));
OnPropertyChanged(nameof(OpenMessageWindow));
OnPropertyChanged(nameof(OpenMouseFollowWindow));
OnPropertyChanged(nameof(OpenNativeCommonWindow));
OnPropertyChanged(nameof(OpenNavigationWindow));
OnPropertyChanged(nameof(OpenNoNonClientAreaDragableWindow));
OnPropertyChanged(nameof(OpenPanel));
OnPropertyChanged(nameof(OpenSprite));
OnPropertyChanged(nameof(OutlineText));
OnPropertyChanged(nameof(Pagination));
OnPropertyChanged(nameof(PasswordBox));
OnPropertyChanged(nameof(PinBox));
OnPropertyChanged(nameof(PleaseInput));
OnPropertyChanged(nameof(PleaseWait));
OnPropertyChanged(nameof(PlsEnterContent));
OnPropertyChanged(nameof(PlsEnterEmail));
OnPropertyChanged(nameof(PlsEnterKey));
OnPropertyChanged(nameof(Poptip));
OnPropertyChanged(nameof(PoptipPositionStr));
OnPropertyChanged(nameof(PracticalDemos));
OnPropertyChanged(nameof(Prev));
OnPropertyChanged(nameof(PreviewSlider));
OnPropertyChanged(nameof(Primary));
OnPropertyChanged(nameof(ProgressBar));
OnPropertyChanged(nameof(ProgressButton));
OnPropertyChanged(nameof(Project));
OnPropertyChanged(nameof(PropertyGrid));
OnPropertyChanged(nameof(PushToTalk));
OnPropertyChanged(nameof(QQGroup));
OnPropertyChanged(nameof(RadioButton));
OnPropertyChanged(nameof(RangeSlider));
OnPropertyChanged(nameof(Rate));
OnPropertyChanged(nameof(Recommendation));
OnPropertyChanged(nameof(Register));
OnPropertyChanged(nameof(RelativePanel));
OnPropertyChanged(nameof(Remark));
OnPropertyChanged(nameof(RemoveItem));
OnPropertyChanged(nameof(RepeatButton));
OnPropertyChanged(nameof(Reply));
OnPropertyChanged(nameof(Repository));
OnPropertyChanged(nameof(ResponsiveLayout));
OnPropertyChanged(nameof(RichTextBox));
OnPropertyChanged(nameof(RightClickHere));
OnPropertyChanged(nameof(RunningBlock));
OnPropertyChanged(nameof(Screenshot));
OnPropertyChanged(nameof(ScrollViewer));
OnPropertyChanged(nameof(SearchBar));
OnPropertyChanged(nameof(Second));
OnPropertyChanged(nameof(Selected));
OnPropertyChanged(nameof(SendNotification));
OnPropertyChanged(nameof(Shield));
OnPropertyChanged(nameof(ShowInCurrentWindow));
OnPropertyChanged(nameof(ShowInMainWindow));
OnPropertyChanged(nameof(ShowRowNumber));
OnPropertyChanged(nameof(SideMenu));
OnPropertyChanged(nameof(Slider));
OnPropertyChanged(nameof(SplitButton));
OnPropertyChanged(nameof(Sprite));
OnPropertyChanged(nameof(StartScreenshot));
OnPropertyChanged(nameof(StaysOpen));
OnPropertyChanged(nameof(Step));
OnPropertyChanged(nameof(StepBar));
OnPropertyChanged(nameof(Styles));
OnPropertyChanged(nameof(SubTitle));
OnPropertyChanged(nameof(Success));
OnPropertyChanged(nameof(TabControl));
OnPropertyChanged(nameof(Tag));
OnPropertyChanged(nameof(Text));
OnPropertyChanged(nameof(TextBlock));
OnPropertyChanged(nameof(TextBox));
OnPropertyChanged(nameof(TextDialog));
OnPropertyChanged(nameof(TextDialogInControl));
OnPropertyChanged(nameof(TextDialogWithTimer));
OnPropertyChanged(nameof(TimeBar));
OnPropertyChanged(nameof(TimePicker));
OnPropertyChanged(nameof(Tip));
OnPropertyChanged(nameof(Title));
OnPropertyChanged(nameof(TitleDemoStr1));
OnPropertyChanged(nameof(TitleDemoStr2));
OnPropertyChanged(nameof(TitleDemoStr3));
OnPropertyChanged(nameof(ToggleButton));
OnPropertyChanged(nameof(ToolBar));
OnPropertyChanged(nameof(Tools));
OnPropertyChanged(nameof(Transfer));
OnPropertyChanged(nameof(TransitioningContentControl));
OnPropertyChanged(nameof(TreeView));
OnPropertyChanged(nameof(Try2CloseApp));
OnPropertyChanged(nameof(Type));
OnPropertyChanged(nameof(UploadFile));
OnPropertyChanged(nameof(UploadStr));
OnPropertyChanged(nameof(Visibility));
OnPropertyChanged(nameof(Vsix));
OnPropertyChanged(nameof(Warning));
OnPropertyChanged(nameof(WaterfallPanel));
OnPropertyChanged(nameof(Website));
OnPropertyChanged(nameof(Window));
OnPropertyChanged(nameof(QQGroup));
OnPropertyChanged(nameof(RadioButton));
OnPropertyChanged(nameof(RangeSlider));
OnPropertyChanged(nameof(Rate));
OnPropertyChanged(nameof(Recommendation));
OnPropertyChanged(nameof(Register));
OnPropertyChanged(nameof(RelativePanel));
OnPropertyChanged(nameof(Remark));
OnPropertyChanged(nameof(RemoveItem));
OnPropertyChanged(nameof(RepeatButton));
OnPropertyChanged(nameof(Reply));
OnPropertyChanged(nameof(Repository));
OnPropertyChanged(nameof(ResponsiveLayout));
OnPropertyChanged(nameof(RichTextBox));
OnPropertyChanged(nameof(RightClickHere));
OnPropertyChanged(nameof(RunningBlock));
OnPropertyChanged(nameof(Screenshot));
OnPropertyChanged(nameof(ScrollViewer));
OnPropertyChanged(nameof(SearchBar));
OnPropertyChanged(nameof(Second));
OnPropertyChanged(nameof(Selected));
OnPropertyChanged(nameof(SendNotification));
OnPropertyChanged(nameof(Shield));
OnPropertyChanged(nameof(ShowInCurrentWindow));
OnPropertyChanged(nameof(ShowInMainWindow));
OnPropertyChanged(nameof(ShowRowNumber));
OnPropertyChanged(nameof(SideMenu));
OnPropertyChanged(nameof(Slider));
OnPropertyChanged(nameof(SplitButton));
OnPropertyChanged(nameof(Sprite));
OnPropertyChanged(nameof(StartScreenshot));
OnPropertyChanged(nameof(StaysOpen));
OnPropertyChanged(nameof(Step));
OnPropertyChanged(nameof(StepBar));
OnPropertyChanged(nameof(Styles));
OnPropertyChanged(nameof(SubTitle));
OnPropertyChanged(nameof(Success));
OnPropertyChanged(nameof(TabControl));
OnPropertyChanged(nameof(Tag));
OnPropertyChanged(nameof(Text));
OnPropertyChanged(nameof(TextBlock));
OnPropertyChanged(nameof(TextBox));
OnPropertyChanged(nameof(TextDialog));
OnPropertyChanged(nameof(TextDialogInControl));
OnPropertyChanged(nameof(TextDialogWithTimer));
OnPropertyChanged(nameof(TimeBar));
OnPropertyChanged(nameof(TimePicker));
OnPropertyChanged(nameof(Tip));
OnPropertyChanged(nameof(Title));
OnPropertyChanged(nameof(TitleDemoStr1));
OnPropertyChanged(nameof(TitleDemoStr2));
OnPropertyChanged(nameof(TitleDemoStr3));
OnPropertyChanged(nameof(ToggleButton));
OnPropertyChanged(nameof(ToolBar));
OnPropertyChanged(nameof(Tools));
OnPropertyChanged(nameof(Transfer));
OnPropertyChanged(nameof(TransitioningContentControl));
OnPropertyChanged(nameof(TreeView));
OnPropertyChanged(nameof(Try2CloseApp));
OnPropertyChanged(nameof(Type));
OnPropertyChanged(nameof(UploadFile));
OnPropertyChanged(nameof(UploadStr));
OnPropertyChanged(nameof(Visibility));
OnPropertyChanged(nameof(Vsix));
OnPropertyChanged(nameof(Warning));
OnPropertyChanged(nameof(WaterfallPanel));
OnPropertyChanged(nameof(Website));
OnPropertyChanged(nameof(Window));
}
/// <summary>
@@ -61,7 +61,7 @@ namespace HandyControlDemo.Service
Index = j,
IsSelected = j % 2 == 0,
Name = $"SubName{j}",
Type = (DemoType)j
Type = (DemoType) j
});
}
var model = new DemoDataModel
@@ -69,7 +69,7 @@ namespace HandyControlDemo.Service
Index = i,
IsSelected = i % 2 == 0,
Name = $"Name{i}",
Type = (DemoType)i,
Type = (DemoType) i,
DataList = dataList,
ImgPath = $"/HandyControlDemo;component/Resources/Img/Avatar/avatar{i % 6 + 1}.png",
Remark = new string(i.ToString()[0], 10)
@@ -91,7 +91,7 @@ namespace HandyControlDemo.Service
Index = i,
IsSelected = i % 2 == 0,
Name = $"Name{i}",
Type = (DemoType)index,
Type = (DemoType) index,
ImgPath = $"/HandyControlDemo;component/Resources/Img/Avatar/avatar{index}.png",
Remark = new string(i.ToString()[0], 10)
};
@@ -129,7 +129,7 @@ namespace HandyControlDemo.Service
Link = item.html_url
}));
}
catch(Exception e)
catch (Exception e)
{
HandyControl.Controls.MessageBox.Error(e.Message, Lang.Error);
}
@@ -396,10 +396,10 @@ namespace HandyControlDemo.Service
foreach (var item in list)
{
var name = (string)item[0];
var name = (string) item[0];
string targetCtlName = item[1];
string imageName = item[2];
var isNew = !string.IsNullOrEmpty((string)item[3]);
var isNew = !string.IsNullOrEmpty((string) item[3]);
resultList.Add(new DemoItemModel
{
@@ -20,7 +20,7 @@ namespace HandyControlDemo.Tools.Converter
return strValue;
}
}
else if(parameter is int intValue)
else if (parameter is int intValue)
{
num = intValue;
}
@@ -8,7 +8,7 @@ namespace HandyControlDemo.UserControl
{
InitializeComponent();
CoverFlowMain.AddRange(new []
CoverFlowMain.AddRange(new[]
{
new Uri(@"pack://application:,,,/Resources/Img/Album/1.jpg"),
new Uri(@"pack://application:,,,/Resources/Img/Album/2.jpg"),
@@ -43,7 +43,7 @@ namespace HandyControlDemo.UserControl
if (tag.Equals(GlobalData.Config.Skin)) return;
GlobalData.Config.Skin = tag;
GlobalData.Save();
((App)Application.Current).UpdateSkin(tag);
((App) Application.Current).UpdateSkin(tag);
}
}
@@ -1,6 +1,6 @@
using GalaSoft.MvvmLight.Command;
using System;
using System;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using HandyControl.Controls;
using HandyControl.Data;
using HandyControlDemo.UserControl;
@@ -94,7 +94,7 @@ namespace HandyControlDemo.ViewModel
}
public RelayCommand<object> MouseCmd => new Lazy<RelayCommand<object>>(() =>
new RelayCommand<object>(str=> Growl.Info(str.ToString()))).Value;
new RelayCommand<object>(str => Growl.Info(str.ToString()))).Value;
public RelayCommand SendNotificationCmd => new Lazy<RelayCommand>(() =>
new RelayCommand(SendNotification)).Value;
@@ -1,8 +1,8 @@
using System;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using HandyControl.Controls;
using HandyControl.Data;
using GalaSoft.MvvmLight.Command;
namespace HandyControlDemo.ViewModel
{
@@ -1,7 +1,7 @@
using System;
using GalaSoft.MvvmLight;
using HandyControl.Controls;
using GalaSoft.MvvmLight.Command;
using HandyControl.Controls;
namespace HandyControlDemo.ViewModel
{
@@ -1,13 +1,13 @@
using System;
using GalaSoft.MvvmLight.Command;
using HandyControl.Controls;
using HandyControlDemo.UserControl;
using GalaSoft.MvvmLight.Command;
namespace HandyControlDemo.ViewModel
{
public class SpriteDemoViewModel
{
public RelayCommand OpenCmd => new Lazy<RelayCommand>(() =>
new RelayCommand(()=> Sprite.Show(new AppSprite()))).Value;
new RelayCommand(() => Sprite.Show(new AppSprite()))).Value;
}
}
@@ -1,10 +1,10 @@
using System;
using System.Windows;
using GalaSoft.MvvmLight.Command;
using HandyControl.Controls;
using HandyControl.Data;
using HandyControlDemo.Data;
using HandyControlDemo.Service;
using GalaSoft.MvvmLight.Command;
namespace HandyControlDemo.ViewModel
{
@@ -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);
}
@@ -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;
}
@@ -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>
/// 最小内容高度
@@ -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);
@@ -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)
{
@@ -15,7 +15,7 @@ namespace HandyControl.Controls
{
if (d is Rectangle rectangle)
{
if ((bool)e.NewValue)
if ((bool) e.NewValue)
{
var binding = new MultiBinding
{
@@ -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);
@@ -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));
@@ -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;
@@ -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);
}
@@ -66,7 +66,7 @@ namespace HandyControl.Controls
public bool IsSelected
{
get => (bool)GetValue(IsSelectedProperty);
get => (bool) GetValue(IsSelectedProperty);
set => SetValue(IsSelectedProperty, ValueBoxes.BooleanBox(value));
}
@@ -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))));
@@ -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));
}
@@ -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);
}
@@ -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);
}
}
@@ -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(
@@ -98,7 +98,7 @@ 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;
}
}
@@ -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)
@@ -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()
@@ -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);
}
@@ -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()
{
@@ -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);
}
@@ -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
@@ -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();
@@ -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);
}
@@ -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);
}
@@ -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))
@@ -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
@@ -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);
@@ -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);
}
@@ -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))
@@ -125,11 +125,11 @@ 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;
}
}
@@ -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))
};
//匀速开始到匀速结束
@@ -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);
}
@@ -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);
}
@@ -100,7 +100,7 @@ namespace HandyControl.Controls
public FrameworkElement Content
{
get => (FrameworkElement)GetValue(ContentProperty);
get => (FrameworkElement) GetValue(ContentProperty);
set => SetValue(ContentProperty, value);
}
@@ -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;
@@ -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);
}
@@ -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
@@ -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);
}
@@ -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));
}
@@ -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)
@@ -463,7 +463,7 @@ namespace HandyControl.Controls
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);
@@ -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>
/// 是否支持惯性
@@ -24,7 +24,7 @@ namespace HandyControl.Controls
{
_isLeftButtonPressed = true;
}
else if(_isLeftButtonPressed)
else if (_isLeftButtonPressed)
{
if (Left < 0)
{
@@ -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
@@ -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
@@ -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(
@@ -54,7 +54,7 @@ namespace HandyControl.Controls
public bool IsIndeterminate
{
get => (bool)GetValue(IsIndeterminateProperty);
get => (bool) GetValue(IsIndeterminateProperty);
set => SetValue(IsIndeterminateProperty, value);
}
@@ -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));
}
@@ -31,7 +31,7 @@ namespace HandyControl.Controls
"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;
((ImagePropertyEditor) d).Source = e.NewValue is Uri uri ? BitmapFrame.Create(uri) : null;
internal Uri Uri
{
@@ -30,7 +30,7 @@ namespace HandyControl.Controls
public PropertyGrid()
{
CommandBindings.Add(new CommandBinding(ControlCommands.SortByCategory, SortByCategory, (s, e) => e.CanExecute = ShowSortButton));
CommandBindings.Add(new CommandBinding(ControlCommands.SortByName, SortByName, (s, e)=> e.CanExecute = ShowSortButton));
CommandBindings.Add(new CommandBinding(ControlCommands.SortByName, SortByName, (s, e) => e.CanExecute = ShowSortButton));
}
public virtual PropertyResolver PropertyResolver { get; } = new PropertyResolver();
@@ -50,7 +50,7 @@ namespace HandyControl.Controls
private static void OnSelectedObjectChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (PropertyGrid)d;
var ctl = (PropertyGrid) d;
ctl.OnSelectedObjectChanged(e.OldValue, e.NewValue);
}
@@ -71,7 +71,7 @@ namespace HandyControl.Controls
public string Description
{
get => (string)GetValue(DescriptionProperty);
get => (string) GetValue(DescriptionProperty);
set => SetValue(DescriptionProperty, value);
}
@@ -22,7 +22,7 @@ namespace HandyControl.Controls
public string DisplayName
{
get => (string)GetValue(DisplayNameProperty);
get => (string) GetValue(DisplayNameProperty);
set => SetValue(DisplayNameProperty, value);
}
@@ -31,7 +31,7 @@ namespace HandyControl.Controls
public string PropertyName
{
get => (string)GetValue(PropertyNameProperty);
get => (string) GetValue(PropertyNameProperty);
set => SetValue(PropertyNameProperty, value);
}
@@ -49,7 +49,7 @@ namespace HandyControl.Controls
public string PropertyTypeName
{
get => (string)GetValue(PropertyTypeNameProperty);
get => (string) GetValue(PropertyTypeNameProperty);
set => SetValue(PropertyTypeNameProperty, value);
}
@@ -58,7 +58,7 @@ namespace HandyControl.Controls
public string Description
{
get => (string)GetValue(DescriptionProperty);
get => (string) GetValue(DescriptionProperty);
set => SetValue(DescriptionProperty, value);
}
@@ -67,7 +67,7 @@ namespace HandyControl.Controls
public bool IsReadOnly
{
get => (bool)GetValue(IsReadOnlyProperty);
get => (bool) GetValue(IsReadOnlyProperty);
set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value));
}
@@ -85,7 +85,7 @@ namespace HandyControl.Controls
public string Category
{
get => (string)GetValue(CategoryProperty);
get => (string) GetValue(CategoryProperty);
set => SetValue(CategoryProperty, value);
}
@@ -94,7 +94,7 @@ namespace HandyControl.Controls
public PropertyEditorBase Editor
{
get => (PropertyEditorBase)GetValue(EditorProperty);
get => (PropertyEditorBase) GetValue(EditorProperty);
set => SetValue(EditorProperty, value);
}
@@ -103,7 +103,7 @@ namespace HandyControl.Controls
public FrameworkElement EditorElement
{
get => (FrameworkElement)GetValue(EditorElementProperty);
get => (FrameworkElement) GetValue(EditorElementProperty);
set => SetValue(EditorElementProperty, value);
}
@@ -112,7 +112,7 @@ namespace HandyControl.Controls
public bool IsExpandedEnabled
{
get => (bool)GetValue(IsExpandedEnabledProperty);
get => (bool) GetValue(IsExpandedEnabledProperty);
set => SetValue(IsExpandedEnabledProperty, ValueBoxes.BooleanBox(value));
}
@@ -37,7 +37,7 @@ namespace HandyControl.Controls
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) =>
((Rate) d).OnValueChanged(new FunctionEventArgs<double>(ValueChangedEvent, d)
{
Info = (double)e.NewValue
Info = (double) e.NewValue
});
protected virtual void OnValueChanged(FunctionEventArgs<double> e)
@@ -154,7 +154,7 @@ namespace HandyControl.Controls
public bool IsReadOnly
{
get => (bool)GetValue(IsReadOnlyProperty);
get => (bool) GetValue(IsReadOnlyProperty);
set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value));
}
@@ -81,7 +81,7 @@ namespace HandyControl.Controls
public bool IsReadOnly
{
get => (bool)GetValue(IsReadOnlyProperty);
get => (bool) GetValue(IsReadOnlyProperty);
set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value));
}
@@ -163,7 +163,7 @@ namespace HandyControl.Controls
if (IsReadOnly) return;
_isSentValue = false;
IsSelected = true;
RaiseEvent(new RoutedEventArgs(SelectedChangedEvent) {Source = this});
RaiseEvent(new RoutedEventArgs(SelectedChangedEvent) { Source = this });
}
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
@@ -192,7 +192,7 @@ namespace HandyControl.Controls
{
if (!_isSentValue)
{
RaiseEvent(new RoutedEventArgs(ValueChangedEvent) {Source = this});
RaiseEvent(new RoutedEventArgs(ValueChangedEvent) { Source = this });
_isMouseLeftButtonDown = false;
_isSentValue = true;
return;
@@ -213,7 +213,7 @@ namespace HandyControl.Controls
}
}
RaiseEvent(new RoutedEventArgs(ValueChangedEvent) {Source = this});
RaiseEvent(new RoutedEventArgs(ValueChangedEvent) { Source = this });
_isMouseLeftButtonDown = false;
}
}
@@ -124,7 +124,7 @@ namespace HandyControl.Controls
public bool IsDrawing
{
get => (bool)GetValue(IsDrawingProperty);
get => (bool) GetValue(IsDrawingProperty);
internal set => SetValue(IsDrawingProperty, ValueBoxes.BooleanBox(value));
}
@@ -133,7 +133,7 @@ namespace HandyControl.Controls
public bool IsSelecting
{
get => (bool)GetValue(IsSelectingProperty);
get => (bool) GetValue(IsSelectingProperty);
internal set => SetValue(IsSelectingProperty, ValueBoxes.BooleanBox(value));
}
@@ -279,8 +279,8 @@ namespace HandyControl.Controls
}
var newPoint = Mouse.GetPosition(this);
var offsetX = (int)(newPoint.X - _mousePointOld.X);
var offsetY = (int)(newPoint.Y - _mousePointOld.Y);
var offsetX = (int) (newPoint.X - _mousePointOld.X);
var offsetY = (int) (newPoint.Y - _mousePointOld.Y);
if (IsDrawing)
{
@@ -320,10 +320,10 @@ namespace HandyControl.Controls
magnifierPos.Y = _pointFloating.Y - 1;
}
rect.Left = (int)Math.Min(_pointFixed.X, _pointFloating.X);
rect.Top = (int)Math.Min(_pointFixed.Y, _pointFloating.Y);
rect.Right = (int)Math.Max(_pointFixed.X, _pointFloating.X);
rect.Bottom = (int)Math.Max(_pointFixed.Y, _pointFloating.Y);
rect.Left = (int) Math.Min(_pointFixed.X, _pointFloating.X);
rect.Top = (int) Math.Min(_pointFixed.Y, _pointFloating.Y);
rect.Right = (int) Math.Max(_pointFixed.X, _pointFloating.X);
rect.Bottom = (int) Math.Max(_pointFixed.Y, _pointFloating.Y);
_magnifier.Show();
MoveMagnifier(magnifierPos);
@@ -334,10 +334,10 @@ namespace HandyControl.Controls
}
else if (IsSelecting)
{
var minX = (int)Math.Min(_mousePointOld.X, newPoint.X);
var maxX = (int)Math.Max(_mousePointOld.X, newPoint.X);
var minY = (int)Math.Min(_mousePointOld.Y, newPoint.Y);
var maxY = (int)Math.Max(_mousePointOld.Y, newPoint.Y);
var minX = (int) Math.Min(_mousePointOld.X, newPoint.X);
var maxX = (int) Math.Max(_mousePointOld.X, newPoint.X);
var minY = (int) Math.Min(_mousePointOld.Y, newPoint.Y);
var maxY = (int) Math.Max(_mousePointOld.Y, newPoint.Y);
MoveTargetArea(new InteropValues.RECT(minX, minY, maxX, maxY));
}
@@ -91,7 +91,7 @@ namespace HandyControl.Controls
{
_isItemSelected = false;
}
else if(_selectedHeader != null)
else if (_selectedHeader != null)
{
if (AutoSelect)
{
@@ -170,7 +170,7 @@ namespace HandyControl.Controls
private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (SideMenuItem)d;
var ctl = (SideMenuItem) d;
if (e.OldValue is ICommand oldCommand)
{
oldCommand.CanExecuteChanged -= ctl.CanExecuteChanged;
@@ -18,7 +18,7 @@ namespace HandyControl.Controls
[TemplatePart(Name = ElementTrack, Type = typeof(Track))]
public class RangeSlider : TwoWayRangeBase
{
private const string ElementTrack= "PART_Track";
private const string ElementTrack = "PART_Track";
private RangeTrack _track;
@@ -136,7 +136,7 @@ namespace HandyControl.Controls
public Orientation Orientation
{
get => (Orientation)GetValue(OrientationProperty);
get => (Orientation) GetValue(OrientationProperty);
set => SetValue(OrientationProperty, value);
}
@@ -145,7 +145,7 @@ namespace HandyControl.Controls
public bool IsDirectionReversed
{
get => (bool)GetValue(IsDirectionReversedProperty);
get => (bool) GetValue(IsDirectionReversedProperty);
set => SetValue(IsDirectionReversedProperty, ValueBoxes.BooleanBox(value));
}
@@ -153,7 +153,7 @@ namespace HandyControl.Controls
public int Delay
{
get => (int)GetValue(DelayProperty);
get => (int) GetValue(DelayProperty);
set => SetValue(DelayProperty, value);
}
@@ -169,7 +169,7 @@ namespace HandyControl.Controls
public int Interval
{
get => (int)GetValue(IntervalProperty);
get => (int) GetValue(IntervalProperty);
set => SetValue(IntervalProperty, value);
}
@@ -186,7 +186,7 @@ namespace HandyControl.Controls
public AutoToolTipPlacement AutoToolTipPlacement
{
get => (AutoToolTipPlacement)GetValue(AutoToolTipPlacementProperty);
get => (AutoToolTipPlacement) GetValue(AutoToolTipPlacementProperty);
set => SetValue(AutoToolTipPlacementProperty, value);
}
@@ -196,7 +196,7 @@ namespace HandyControl.Controls
public int AutoToolTipPrecision
{
get => (int)GetValue(AutoToolTipPrecisionProperty);
get => (int) GetValue(AutoToolTipPrecisionProperty);
set => SetValue(AutoToolTipPrecisionProperty, value);
}
@@ -205,7 +205,7 @@ namespace HandyControl.Controls
public bool IsSnapToTickEnabled
{
get => (bool)GetValue(IsSnapToTickEnabledProperty);
get => (bool) GetValue(IsSnapToTickEnabledProperty);
set => SetValue(IsSnapToTickEnabledProperty, ValueBoxes.BooleanBox(value));
}
@@ -214,7 +214,7 @@ namespace HandyControl.Controls
public TickPlacement TickPlacement
{
get => (TickPlacement)GetValue(TickPlacementProperty);
get => (TickPlacement) GetValue(TickPlacementProperty);
set => SetValue(TickPlacementProperty, value);
}
@@ -224,7 +224,7 @@ namespace HandyControl.Controls
public double TickFrequency
{
get => (double)GetValue(TickFrequencyProperty);
get => (double) GetValue(TickFrequencyProperty);
set => SetValue(TickFrequencyProperty, value);
}
@@ -233,7 +233,7 @@ namespace HandyControl.Controls
public DoubleCollection Ticks
{
get => (DoubleCollection)GetValue(TicksProperty);
get => (DoubleCollection) GetValue(TicksProperty);
set => SetValue(TicksProperty, value);
}
@@ -242,7 +242,7 @@ namespace HandyControl.Controls
public bool IsMoveToPointEnabled
{
get => (bool)GetValue(IsMoveToPointEnabledProperty);
get => (bool) GetValue(IsMoveToPointEnabledProperty);
set => SetValue(IsMoveToPointEnabledProperty, ValueBoxes.BooleanBox(value));
}
@@ -522,7 +522,7 @@ namespace HandyControl.Controls
private string GetAutoToolTipNumber(bool isStart)
{
var format = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone();
var format = (NumberFormatInfo) NumberFormatInfo.CurrentInfo.Clone();
format.NumberDecimalDigits = AutoToolTipPrecision;
return isStart ? ValueStart.ToString("N", format) : ValueEnd.ToString("N", format);
}
@@ -603,7 +603,7 @@ namespace HandyControl.Controls
{
if (e.ChangedButton != MouseButton.Left) return;
var slider = (RangeSlider)sender;
var slider = (RangeSlider) sender;
// When someone click on the Slider's part, and it's not focusable
// Slider need to take the focus in order to process keyboard correctly
@@ -364,7 +364,7 @@ namespace HandyControl.Controls
private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if ((bool)e.NewValue)
if ((bool) e.NewValue)
{
Mouse.Synchronize();
}
@@ -1,9 +1,9 @@
// Adapted from https://referencesource.microsoft.com/#PresentationFramework/src/Framework/System/Windows/Controls/Primitives/RangeBase.cs
using HandyControl.Data;
using HandyControl.Tools;
using System.Windows;
using System.Windows.Controls;
using HandyControl.Data;
using HandyControl.Tools;
namespace HandyControl.Controls
{
@@ -15,12 +15,12 @@ namespace HandyControl.Controls
private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctrl = (TwoWayRangeBase)d;
var ctrl = (TwoWayRangeBase) d;
ctrl.CoerceValue(MaximumProperty);
ctrl.CoerceValue(ValueStartProperty);
ctrl.CoerceValue(ValueEndProperty);
ctrl.OnMinimumChanged((double)e.OldValue, (double)e.NewValue);
ctrl.OnMinimumChanged((double) e.OldValue, (double) e.NewValue);
}
protected virtual void OnMinimumChanged(double oldMinimum, double newMinimum)
@@ -29,7 +29,7 @@ namespace HandyControl.Controls
public double Minimum
{
get => (double)GetValue(MinimumProperty);
get => (double) GetValue(MinimumProperty);
set => SetValue(MinimumProperty, value);
}
@@ -40,9 +40,9 @@ namespace HandyControl.Controls
private static object CoerceMaximum(DependencyObject d, object basevalue)
{
var ctrl = (TwoWayRangeBase)d;
var ctrl = (TwoWayRangeBase) d;
var min = ctrl.Minimum;
if ((double)basevalue < min)
if ((double) basevalue < min)
{
return min;
}
@@ -51,11 +51,11 @@ namespace HandyControl.Controls
private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctrl = (TwoWayRangeBase)d;
var ctrl = (TwoWayRangeBase) d;
ctrl.CoerceValue(ValueStartProperty);
ctrl.CoerceValue(ValueEndProperty);
ctrl.OnMaximumChanged((double)e.OldValue, (double)e.NewValue);
ctrl.OnMaximumChanged((double) e.OldValue, (double) e.NewValue);
}
protected virtual void OnMaximumChanged(double oldMaximum, double newMaximum)
@@ -64,7 +64,7 @@ namespace HandyControl.Controls
public double Maximum
{
get => (double)GetValue(MaximumProperty);
get => (double) GetValue(MaximumProperty);
set => SetValue(MaximumProperty, value);
}
@@ -76,24 +76,24 @@ namespace HandyControl.Controls
private static void OnValueStartChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctrl = (TwoWayRangeBase)d;
var ctrl = (TwoWayRangeBase) d;
ctrl.OnValueChanged(new DoubleRange
{
Start = (double)e.OldValue,
Start = (double) e.OldValue,
End = ctrl.ValueEnd
}, new DoubleRange
{
Start = (double)e.NewValue,
Start = (double) e.NewValue,
End = ctrl.ValueEnd
});
}
protected virtual void OnValueChanged(DoubleRange oldValue, DoubleRange newValue) => RaiseEvent(
new RoutedPropertyChangedEventArgs<DoubleRange>(oldValue, newValue) {RoutedEvent = ValueChangedEvent});
new RoutedPropertyChangedEventArgs<DoubleRange>(oldValue, newValue) { RoutedEvent = ValueChangedEvent });
public double ValueStart
{
get => (double)GetValue(ValueStartProperty);
get => (double) GetValue(ValueStartProperty);
set => SetValue(ValueStartProperty, value);
}
@@ -105,29 +105,29 @@ namespace HandyControl.Controls
private static void OnValueEndChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctrl = (TwoWayRangeBase)d;
var ctrl = (TwoWayRangeBase) d;
ctrl.OnValueChanged(new DoubleRange
{
Start = ctrl.ValueStart,
End = (double)e.OldValue
End = (double) e.OldValue
}, new DoubleRange
{
Start = ctrl.ValueStart,
End = (double)e.NewValue
End = (double) e.NewValue
});
}
public double ValueEnd
{
get => (double)GetValue(ValueEndProperty);
get => (double) GetValue(ValueEndProperty);
set => SetValue(ValueEndProperty, value);
}
internal static object ConstrainToRange(DependencyObject d, object value)
{
var ctrl = (TwoWayRangeBase)d;
var ctrl = (TwoWayRangeBase) d;
var min = ctrl.Minimum;
var v = (double)value;
var v = (double) value;
if (v < min)
{
return min;
@@ -148,7 +148,7 @@ namespace HandyControl.Controls
public double LargeChange
{
get => (double)GetValue(LargeChangeProperty);
get => (double) GetValue(LargeChangeProperty);
set => SetValue(LargeChangeProperty, value);
}
@@ -158,7 +158,7 @@ namespace HandyControl.Controls
public double SmallChange
{
get => (double)GetValue(SmallChangeProperty);
get => (double) GetValue(SmallChangeProperty);
set => SetValue(SmallChangeProperty, value);
}
@@ -87,7 +87,7 @@ namespace HandyControl.Controls
private static object CoerceStepIndex(DependencyObject d, object basevalue)
{
var ctl = (StepBar)d;
var ctl = (StepBar) d;
var stepIndex = (int) basevalue;
if (ctl.Items.Count == 0 && stepIndex > 0)
{
@@ -105,7 +105,7 @@ namespace HandyControl.Controls
private static void OnStepIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (StepBar) d;
ctl.OnStepIndexChanged((int)e.NewValue);
ctl.OnStepIndexChanged((int) e.NewValue);
}
private void OnStepIndexChanged(int stepIndex)
@@ -138,7 +138,7 @@ namespace HandyControl.Controls
public int StepIndex
{
get => (int)GetValue(StepIndexProperty);
get => (int) GetValue(StepIndexProperty);
set => SetValue(StepIndexProperty, value);
}
@@ -147,7 +147,7 @@ namespace HandyControl.Controls
public Dock Dock
{
get => (Dock)GetValue(DockProperty);
get => (Dock) GetValue(DockProperty);
set => SetValue(DockProperty, value);
}
@@ -58,7 +58,7 @@ namespace HandyControl.Controls
/// </summary>
public bool IsAnimationEnabled
{
get => (bool)GetValue(IsAnimationEnabledProperty);
get => (bool) GetValue(IsAnimationEnabledProperty);
set => SetValue(IsAnimationEnabledProperty, ValueBoxes.BooleanBox(value));
}
@@ -73,7 +73,7 @@ namespace HandyControl.Controls
/// </summary>
public bool IsDraggable
{
get => (bool)GetValue(IsDraggableProperty);
get => (bool) GetValue(IsDraggableProperty);
set => SetValue(IsDraggableProperty, ValueBoxes.BooleanBox(value));
}
@@ -94,7 +94,7 @@ namespace HandyControl.Controls
/// </summary>
public bool ShowCloseButton
{
get => (bool)GetValue(ShowCloseButtonProperty);
get => (bool) GetValue(ShowCloseButtonProperty);
set => SetValue(ShowCloseButtonProperty, value);
}
@@ -115,7 +115,7 @@ namespace HandyControl.Controls
/// </summary>
public bool ShowContextMenu
{
get => (bool)GetValue(ShowContextMenuProperty);
get => (bool) GetValue(ShowContextMenuProperty);
set => SetValue(ShowContextMenuProperty, value);
}
@@ -130,7 +130,7 @@ namespace HandyControl.Controls
/// </summary>
public bool IsTabFillEnabled
{
get => (bool)GetValue(IsTabFillEnabledProperty);
get => (bool) GetValue(IsTabFillEnabledProperty);
set => SetValue(IsTabFillEnabledProperty, ValueBoxes.BooleanBox(value));
}
@@ -145,7 +145,7 @@ namespace HandyControl.Controls
/// </summary>
public double TabItemWidth
{
get => (double)GetValue(TabItemWidthProperty);
get => (double) GetValue(TabItemWidthProperty);
set => SetValue(TabItemWidthProperty, value);
}
@@ -160,7 +160,7 @@ namespace HandyControl.Controls
/// </summary>
public double TabItemHeight
{
get => (double)GetValue(TabItemHeightProperty);
get => (double) GetValue(TabItemHeightProperty);
set => SetValue(TabItemHeightProperty, value);
}
@@ -299,7 +299,7 @@ namespace HandyControl.Controls
{
if (!IsTabFillEnabled)
{
_itemShowCount = (int)(ActualWidth / TabItemWidth);
_itemShowCount = (int) (ActualWidth / TabItemWidth);
_buttonOverflow?.Show(ShowOverflowButton && Items.Count > 0 && Items.Count >= _itemShowCount);
}
}
@@ -321,7 +321,7 @@ namespace HandyControl.Controls
_buttonOverflow.Menu.Items.Clear();
for (var i = 0; i < Items.Count; i++)
{
if(!(ItemContainerGenerator.ContainerFromIndex(i) is TabItem item)) continue;
if (!(ItemContainerGenerator.ContainerFromIndex(i) is TabItem item)) continue;
var menuItem = new MenuItem
{
@@ -140,7 +140,7 @@ namespace HandyControl.Controls
/// </summary>
public bool ShowCloseButton
{
get => (bool)GetValue(ShowCloseButtonProperty);
get => (bool) GetValue(ShowCloseButtonProperty);
set => SetValue(ShowCloseButtonProperty, value);
}
@@ -148,7 +148,7 @@ namespace HandyControl.Controls
=> element.SetValue(ShowCloseButtonProperty, ValueBoxes.BooleanBox(value));
public static bool GetShowCloseButton(DependencyObject element)
=> (bool)element.GetValue(ShowCloseButtonProperty);
=> (bool) element.GetValue(ShowCloseButtonProperty);
/// <summary>
/// 是否显示上下文菜单
@@ -161,7 +161,7 @@ namespace HandyControl.Controls
var ctl = (TabItem) d;
if (ctl.Menu != null)
{
var show = (bool)e.NewValue;
var show = (bool) e.NewValue;
ctl.Menu.IsEnabled = show;
ctl.Menu.Show(show);
}
@@ -180,7 +180,7 @@ namespace HandyControl.Controls
=> element.SetValue(ShowContextMenuProperty, ValueBoxes.BooleanBox(value));
public static bool GetShowContextMenu(DependencyObject element)
=> (bool)element.GetValue(ShowContextMenuProperty);
=> (bool) element.GetValue(ShowContextMenuProperty);
public static readonly DependencyProperty MenuProperty = DependencyProperty.Register(
"Menu", typeof(ContextMenu), typeof(TabItem), new PropertyMetadata(default(ContextMenu), OnMenuChanged));
@@ -450,7 +450,7 @@ namespace HandyControl.Controls
}
var maxIndex = TabControlParent.Items.Count - 1;
var div = (int)(left / ItemWidth);
var div = (int) (left / ItemWidth);
var rest = left % ItemWidth;
var result = rest / ItemWidth > .5 ? div + 1 : div;
@@ -37,7 +37,7 @@ namespace HandyControl.Controls
/// </summary>
public Duration FluidMoveDuration
{
get => (Duration)GetValue(FluidMoveDurationProperty);
get => (Duration) GetValue(FluidMoveDurationProperty);
set => SetValue(FluidMoveDurationProperty, value);
}
@@ -52,7 +52,7 @@ namespace HandyControl.Controls
/// </summary>
public bool IsTabFillEnabled
{
get => (bool)GetValue(IsTabFillEnabledProperty);
get => (bool) GetValue(IsTabFillEnabledProperty);
set => SetValue(IsTabFillEnabledProperty, ValueBoxes.BooleanBox(value));
}
@@ -67,7 +67,7 @@ namespace HandyControl.Controls
/// </summary>
public double TabItemWidth
{
get => (double)GetValue(TabItemWidthProperty);
get => (double) GetValue(TabItemWidthProperty);
set => SetValue(TabItemWidthProperty, value);
}
@@ -82,7 +82,7 @@ namespace HandyControl.Controls
/// </summary>
public double TabItemHeight
{
get => (double)GetValue(TabItemHeightProperty);
get => (double) GetValue(TabItemHeightProperty);
set => SetValue(TabItemHeightProperty, value);
}
@@ -127,7 +127,7 @@ namespace HandyControl.Controls
{
if (TemplatedParent is TabControl tabControl)
{
arr = ArithmeticHelper.DivideInt2Arr((int)tabControl.ActualWidth + InternalChildren.Count, count);
arr = ArithmeticHelper.DivideInt2Arr((int) tabControl.ActualWidth + InternalChildren.Count, count);
}
}
@@ -58,7 +58,7 @@ namespace HandyControl.Controls
private static void OnHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctrl = (Tag)d;
var ctrl = (Tag) d;
ctrl.SetValue(HasHeaderPropertyKey, e.NewValue != null ? ValueBoxes.TrueBox : ValueBoxes.FalseBox);
ctrl.OnHeaderChanged(e.OldValue, e.NewValue);
@@ -108,7 +108,7 @@ namespace HandyControl.Controls
public FontFamily FontFamily
{
get => (FontFamily)GetValue(FontFamilyProperty);
get => (FontFamily) GetValue(FontFamilyProperty);
set => SetValue(FontFamilyProperty, value);
}
@@ -119,7 +119,7 @@ namespace HandyControl.Controls
[TypeConverter(typeof(FontSizeConverter))]
public double FontSize
{
get => (double)GetValue(FontSizeProperty);
get => (double) GetValue(FontSizeProperty);
set => SetValue(FontSizeProperty, value);
}
@@ -129,7 +129,7 @@ namespace HandyControl.Controls
public FontStretch FontStretch
{
get => (FontStretch)GetValue(FontStretchProperty);
get => (FontStretch) GetValue(FontStretchProperty);
set => SetValue(FontStretchProperty, value);
}
@@ -139,7 +139,7 @@ namespace HandyControl.Controls
public FontStyle FontStyle
{
get => (FontStyle)GetValue(FontStyleProperty);
get => (FontStyle) GetValue(FontStyleProperty);
set => SetValue(FontStyleProperty, value);
}
@@ -149,7 +149,7 @@ namespace HandyControl.Controls
public FontWeight FontWeight
{
get => (FontWeight)GetValue(FontWeightProperty);
get => (FontWeight) GetValue(FontWeightProperty);
set => SetValue(FontWeightProperty, value);
}
@@ -264,7 +264,7 @@ namespace HandyControl.Controls
private static void OnFormattedTextUpdated(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var outlinedTextBlock = (OutlineText)d;
var outlinedTextBlock = (OutlineText) d;
outlinedTextBlock.UpdateFormattedText();
outlinedTextBlock._textGeometry = null;
@@ -274,7 +274,7 @@ namespace HandyControl.Controls
private static void OnFormattedTextInvalidated(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var outlinedTextBlock = (OutlineText)d;
var outlinedTextBlock = (OutlineText) d;
outlinedTextBlock._formattedText = null;
outlinedTextBlock._textGeometry = null;
@@ -26,7 +26,7 @@ namespace HandyControl.Controls
public string Text
{
get => (string)GetValue(TextProperty);
get => (string) GetValue(TextProperty);
set => SetValue(TextProperty, value);
}
@@ -36,7 +36,7 @@ namespace HandyControl.Controls
public TextAlignment TextAlignment
{
get => (TextAlignment)GetValue(TextAlignmentProperty);
get => (TextAlignment) GetValue(TextAlignmentProperty);
set => SetValue(TextAlignmentProperty, value);
}
@@ -46,7 +46,7 @@ namespace HandyControl.Controls
public TextTrimming TextTrimming
{
get => (TextTrimming)GetValue(TextTrimmingProperty);
get => (TextTrimming) GetValue(TextTrimmingProperty);
set => SetValue(TextTrimmingProperty, value);
}
@@ -56,7 +56,7 @@ namespace HandyControl.Controls
public TextWrapping TextWrapping
{
get => (TextWrapping)GetValue(TextWrappingProperty);
get => (TextWrapping) GetValue(TextWrappingProperty);
set => SetValue(TextWrappingProperty, value);
}
@@ -75,7 +75,7 @@ namespace HandyControl.Controls
public FontFamily FontFamily
{
get => (FontFamily)GetValue(FontFamilyProperty);
get => (FontFamily) GetValue(FontFamilyProperty);
set => SetValue(FontFamilyProperty, value);
}
@@ -86,7 +86,7 @@ namespace HandyControl.Controls
[TypeConverter(typeof(FontSizeConverter))]
public double FontSize
{
get => (double)GetValue(FontSizeProperty);
get => (double) GetValue(FontSizeProperty);
set => SetValue(FontSizeProperty, value);
}
@@ -96,7 +96,7 @@ namespace HandyControl.Controls
public FontStretch FontStretch
{
get => (FontStretch)GetValue(FontStretchProperty);
get => (FontStretch) GetValue(FontStretchProperty);
set => SetValue(FontStretchProperty, value);
}
@@ -106,7 +106,7 @@ namespace HandyControl.Controls
public FontStyle FontStyle
{
get => (FontStyle)GetValue(FontStyleProperty);
get => (FontStyle) GetValue(FontStyleProperty);
set => SetValue(FontStyleProperty, value);
}
@@ -116,7 +116,7 @@ namespace HandyControl.Controls
public FontWeight FontWeight
{
get => (FontWeight)GetValue(FontWeightProperty);
get => (FontWeight) GetValue(FontWeightProperty);
set => SetValue(FontWeightProperty, value);
}
@@ -175,7 +175,7 @@ namespace HandyControl.Controls
private static void OnFormattedTextUpdated(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var outlinedTextBlock = (SimpleText)d;
var outlinedTextBlock = (SimpleText) d;
outlinedTextBlock.UpdateFormattedText();
outlinedTextBlock.InvalidateMeasure();
@@ -184,7 +184,7 @@ namespace HandyControl.Controls
private static void OnFormattedTextInvalidated(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var outlinedTextBlock = (SimpleText)d;
var outlinedTextBlock = (SimpleText) d;
outlinedTextBlock._formattedText = null;
outlinedTextBlock.InvalidateMeasure();
@@ -77,7 +77,7 @@ namespace HandyControl.Controls
public string DateTimeFormat
{
get => (string)GetValue(DateTimeFormatProperty);
get => (string) GetValue(DateTimeFormatProperty);
set => SetValue(DateTimeFormatProperty, value);
}
@@ -86,7 +86,7 @@ namespace HandyControl.Controls
public bool ShowConfirmButton
{
get => (bool)GetValue(ShowConfirmButtonProperty);
get => (bool) GetValue(ShowConfirmButtonProperty);
set => SetValue(ShowConfirmButtonProperty, ValueBoxes.BooleanBox(value));
}
@@ -95,8 +95,8 @@ namespace HandyControl.Controls
private static void OnSelectedDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (CalendarWithClock)d;
var v = (DateTime?)e.NewValue;
var ctl = (CalendarWithClock) d;
var v = (DateTime?) e.NewValue;
ctl.OnSelectedDateTimeChanged(new FunctionEventArgs<DateTime?>(SelectedDateTimeChangedEvent, ctl)
{
Info = v
@@ -105,7 +105,7 @@ namespace HandyControl.Controls
public DateTime? SelectedDateTime
{
get => (DateTime?)GetValue(SelectedDateTimeProperty);
get => (DateTime?) GetValue(SelectedDateTimeProperty);
set => SetValue(SelectedDateTimeProperty, value);
}
@@ -114,9 +114,9 @@ namespace HandyControl.Controls
private static void OnDisplayDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (CalendarWithClock)d;
var ctl = (CalendarWithClock) d;
if (ctl.IsHandlerSuspended(DisplayDateTimeProperty)) return;
var v = (DateTime)e.NewValue;
var v = (DateTime) e.NewValue;
ctl._clock.SelectedTime = v;
ctl._calendar.SelectedDate = v;
ctl.OnDisplayDateTimeChanged(new FunctionEventArgs<DateTime>(v));
@@ -124,7 +124,7 @@ namespace HandyControl.Controls
public DateTime DisplayDateTime
{
get => (DateTime)GetValue(DisplayDateTimeProperty);
get => (DateTime) GetValue(DisplayDateTimeProperty);
set => SetValue(DisplayDateTimeProperty, value);
}
@@ -203,7 +203,7 @@ namespace HandyControl.Controls
private void Canvas_OnMouseWheel(object sender, MouseWheelEventArgs e)
{
var value = (int)_rotateTransformClock.Angle;
var value = (int) _rotateTransformClock.Angle;
if (e.Delta < 0)
{
value += 6;
@@ -297,7 +297,7 @@ namespace HandyControl.Controls
var hRest = h % 12;
if (hRest == 0) hRest = 12;
var ctl = _radioButtonList[hRest-1];
var ctl = _radioButtonList[hRest - 1];
ctl.IsChecked = true;
ctl.RaiseEvent(new RoutedEventArgs { RoutedEvent = ButtonBase.ClickEvent });
@@ -322,7 +322,7 @@ namespace HandyControl.Controls
hValue = 0;
}
var now = DateTime.Now;
return new DateTime(now.Year, now.Month, now.Day, hValue, (int)Math.Abs(_rotateTransformClock.Angle) % 360 / 6, _secValue);
return new DateTime(now.Year, now.Month, now.Day, hValue, (int) Math.Abs(_rotateTransformClock.Angle) % 360 / 6, _secValue);
}
private void ButtonAm_OnClick(object sender, RoutedEventArgs e) => Update();
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
public string TimeFormat
{
get => (string)GetValue(TimeFormatProperty);
get => (string) GetValue(TimeFormatProperty);
set => SetValue(TimeFormatProperty, value);
}
@@ -42,8 +42,8 @@ namespace HandyControl.Controls
private static void OnSelectedTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (ClockBase)d;
var v = (DateTime?)e.NewValue;
var ctl = (ClockBase) d;
var v = (DateTime?) e.NewValue;
ctl.DisplayTime = v ?? DateTime.Now;
ctl.OnSelectedTimeChanged(new FunctionEventArgs<DateTime?>(SelectedTimeChangedEvent, ctl)
{
@@ -64,15 +64,15 @@ namespace HandyControl.Controls
private static void OnDisplayTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (ClockBase)d;
var v = (DateTime)e.NewValue;
var ctl = (ClockBase) d;
var v = (DateTime) e.NewValue;
ctl.Update(v);
ctl.OnDisplayTimeChanged(new FunctionEventArgs<DateTime>(v));
}
public DateTime DisplayTime
{
get => (DateTime)GetValue(DisplayTimeProperty);
get => (DateTime) GetValue(DisplayTimeProperty);
set => SetValue(DisplayTimeProperty, value);
}
@@ -13,7 +13,7 @@ namespace HandyControl.Controls
private bool _isDisposed;
public static readonly DependencyProperty NumberListProperty = DependencyProperty.Register(
"NumberList", typeof(List<int>), typeof(FlipClock), new PropertyMetadata(new List<int> {0, 0, 0, 0, 0, 0}));
"NumberList", typeof(List<int>), typeof(FlipClock), new PropertyMetadata(new List<int> { 0, 0, 0, 0, 0, 0 }));
public List<int> NumberList
{
@@ -40,7 +40,7 @@ namespace HandyControl.Controls
public CornerRadius CornerRadius
{
get => (CornerRadius)GetValue(CornerRadiusProperty);
get => (CornerRadius) GetValue(CornerRadiusProperty);
set => SetValue(CornerRadiusProperty, value);
}
@@ -49,7 +49,7 @@ namespace HandyControl.Controls
public Brush Background
{
get => (Brush)GetValue(BackgroundProperty);
get => (Brush) GetValue(BackgroundProperty);
set => SetValue(BackgroundProperty, value);
}
@@ -58,7 +58,7 @@ namespace HandyControl.Controls
public Brush Foreground
{
get => (Brush)GetValue(ForegroundProperty);
get => (Brush) GetValue(ForegroundProperty);
set => SetValue(ForegroundProperty, value);
}
@@ -68,7 +68,7 @@ namespace HandyControl.Controls
[TypeConverter(typeof(FontSizeConverter))]
public double FontSize
{
get => (double)GetValue(FontSizeProperty);
get => (double) GetValue(FontSizeProperty);
set => SetValue(FontSizeProperty, value);
}
@@ -76,11 +76,11 @@ namespace HandyControl.Controls
"Number", typeof(int), typeof(FlipNumber), new PropertyMetadata(ValueBoxes.Int0Box, OnNumberChanged));
private static void OnNumberChanged(DependencyObject s, DependencyPropertyChangedEventArgs e) =>
((FlipNumber)s).OnNumberChanged();
((FlipNumber) s).OnNumberChanged();
public int Number
{
get => (int)GetValue(NumberProperty);
get => (int) GetValue(NumberProperty);
set => SetValue(NumberProperty, value);
}
@@ -78,7 +78,7 @@ namespace HandyControl.Controls
/// </summary>
public bool ShowSpeStr
{
get => (bool)GetValue(ShowSpeStrProperty);
get => (bool) GetValue(ShowSpeStrProperty);
set => SetValue(ShowSpeStrProperty, ValueBoxes.BooleanBox(value));
}
@@ -102,7 +102,7 @@ namespace HandyControl.Controls
/// </summary>
internal string SpeStr
{
get => (string)GetValue(SpeStrProperty);
get => (string) GetValue(SpeStrProperty);
set => SetValue(SpeStrProperty, value);
}
@@ -116,7 +116,7 @@ namespace HandyControl.Controls
{
if (d is TimeBar timeBar && timeBar._textBlockSelected != null)
{
timeBar.OnSelectedTimeChanged((DateTime)e.NewValue);
timeBar.OnSelectedTimeChanged((DateTime) e.NewValue);
}
}
@@ -125,7 +125,7 @@ namespace HandyControl.Controls
/// </summary>
public DateTime SelectedTime
{
get => (DateTime)GetValue(SelectedTimeProperty);
get => (DateTime) GetValue(SelectedTimeProperty);
set => SetValue(SelectedTimeProperty, value);
}
@@ -237,7 +237,7 @@ namespace HandyControl.Controls
_dateTimeRanges.Add(item);
}
}
else if(e.Action == NotifyCollectionChangedAction.Remove)
else if (e.Action == NotifyCollectionChangedAction.Remove)
{
foreach (DateTimeRange item in e.OldItems)
{
@@ -300,7 +300,7 @@ namespace HandyControl.Controls
private void CheckNull()
{
if (_borderTop == null || _textBlockMove == null|| _textBlockSelected == null || _canvasSpe == null) throw new Exception();
if (_borderTop == null || _textBlockMove == null || _textBlockSelected == null || _canvasSpe == null) throw new Exception();
}
/// <summary>
@@ -477,7 +477,7 @@ namespace HandyControl.Controls
_speBlockList.Clear();
_canvasSpe.Children.Clear();
_speCount = (int)(ActualWidth / 800 * 9) | 1;
_speCount = (int) (ActualWidth / 800 * 9) | 1;
var itemWidthOld = _itemWidth;
_itemWidth = ActualWidth / _speCount;
@@ -57,7 +57,7 @@ namespace HandyControl.Controls
public IList SelectedItems
{
get => (IList)GetValue(SelectedItemsProperty);
get => (IList) GetValue(SelectedItemsProperty);
set => SetValue(SelectedItemsProperty, value);
}
@@ -17,9 +17,9 @@ namespace HandyControl.Controls
private static SystemVersionInfo GetSystemVersionInfo()
{
var osv = new InteropValues.RTL_OSVERSIONINFOEX();
osv.dwOSVersionInfoSize = (uint)Marshal.SizeOf(osv);
osv.dwOSVersionInfoSize = (uint) Marshal.SizeOf(osv);
InteropMethods.Gdip.RtlGetVersion(out osv);
return new SystemVersionInfo((int)osv.dwMajorVersion, (int)osv.dwMinorVersion, (int)osv.dwBuildNumber);
return new SystemVersionInfo((int) osv.dwMajorVersion, (int) osv.dwMinorVersion, (int) osv.dwBuildNumber);
}
internal static void EnableBlur(Window window)
@@ -35,7 +35,7 @@ namespace HandyControl.Controls
public Color ActiveGlowColor
{
get => (Color)GetValue(ActiveGlowColorProperty);
get => (Color) GetValue(ActiveGlowColorProperty);
set => SetValue(ActiveGlowColorProperty, value);
}
@@ -44,7 +44,7 @@ namespace HandyControl.Controls
public Color InactiveGlowColor
{
get => (Color)GetValue(InactiveGlowColorProperty);
get => (Color) GetValue(InactiveGlowColorProperty);
set => SetValue(InactiveGlowColorProperty, value);
}
@@ -195,7 +195,7 @@ namespace HandyControl.Controls
private GlowEdge GetOrCreateGlowWindow(int direction)
{
return _glowEdges[direction] ?? (_glowEdges[direction] = new GlowEdge(this, (Dock)direction)
return _glowEdges[direction] ?? (_glowEdges[direction] = new GlowEdge(this, (Dock) direction)
{
ActiveGlowColor = ActiveGlowColor,
InactiveGlowColor = InactiveGlowColor,
@@ -205,11 +205,11 @@ namespace HandyControl.Controls
private static void OnResizeModeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
{
var customChromeWindow = (GlowWindow)obj;
var customChromeWindow = (GlowWindow) obj;
customChromeWindow.UpdateGlowVisibility(false);
}
private static void OnGlowColorChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) => ((GlowWindow)obj).UpdateGlowColors();
private static void OnGlowColorChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) => ((GlowWindow) obj).UpdateGlowColors();
private void UpdateGlowColors()
{
@@ -303,7 +303,7 @@ namespace HandyControl.Controls
private void WmWindowPosChanging(IntPtr lParam)
{
var windowpos = (InteropValues.WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS));
var windowpos = (InteropValues.WINDOWPOS) Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS));
if ((windowpos.flags & 2u) == 0u && (windowpos.flags & 1u) == 0u && windowpos.cx > 0 && windowpos.cy > 0)
{
var rect = new Rect(windowpos.x, windowpos.y, windowpos.cx, windowpos.cy);
@@ -317,8 +317,8 @@ namespace HandyControl.Controls
var logicalRect = GetOnScreenPosition(rect);
logicalRect = logicalRect.LogicalToDeviceUnits();
windowpos.x = (int)logicalRect.X;
windowpos.y = (int)logicalRect.Y;
windowpos.x = (int) logicalRect.X;
windowpos.y = (int) logicalRect.Y;
Marshal.StructureToPtr(windowpos, lParam, true);
}
}
@@ -364,7 +364,7 @@ namespace HandyControl.Controls
{
try
{
var windowpos = (InteropValues.WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS));
var windowpos = (InteropValues.WINDOWPOS) Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS));
UpdateGlowWindowPositions((windowpos.flags & 64u) == 0u);
UpdateZOrderOfThisAndOwner();
@@ -399,7 +399,7 @@ namespace HandyControl.Controls
{
var hMonitor = InteropMethods.MonitorFromWindow(hWnd, 2);
var result = default(InteropValues.MONITORINFO);
result.cbSize = (uint)Marshal.SizeOf(typeof(InteropValues.MONITORINFO));
result.cbSize = (uint) Marshal.SizeOf(typeof(InteropValues.MONITORINFO));
InteropMethods.GetMonitorInfo(hMonitor, ref result);
return result;
}
Loaded 100 of 165 files, more files were not shown because too many files have changed in this diff. Show more