Merge branch 'master' of https://github.com/HandyOrg/HandyControl
This commit is contained in:
commit
04b01db546
34 files changed
+253
-253
No files matched your search
@@ -27,13 +27,13 @@ public partial class App
|
||||
public App()
|
||||
{
|
||||
#if !NET40
|
||||
var cachePath = $"{AppDomain.CurrentDomain.BaseDirectory}Cache";
|
||||
if (!Directory.Exists(cachePath))
|
||||
{
|
||||
Directory.CreateDirectory(cachePath);
|
||||
}
|
||||
ProfileOptimization.SetProfileRoot(cachePath);
|
||||
ProfileOptimization.StartProfile("Profile");
|
||||
var cachePath = $"{AppDomain.CurrentDomain.BaseDirectory}Cache";
|
||||
if (!Directory.Exists(cachePath))
|
||||
{
|
||||
Directory.CreateDirectory(cachePath);
|
||||
}
|
||||
ProfileOptimization.SetProfileRoot(cachePath);
|
||||
ProfileOptimization.StartProfile("Profile");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public partial class App
|
||||
#if NET40
|
||||
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
|
||||
#else
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class DemoItemModel : ObservableObject
|
||||
#if NET40
|
||||
set => Set(nameof(QueriesText), ref _queriesText, value);
|
||||
#else
|
||||
set => Set(ref _queriesText, value);
|
||||
set => Set(ref _queriesText, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class DemoItemModel : ObservableObject
|
||||
#if NET40
|
||||
set => Set(nameof(IsVisible), ref _isVisible, value);
|
||||
#else
|
||||
set => Set(ref _isVisible, value);
|
||||
set => Set(ref _isVisible, value);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ internal class VersionHelper
|
||||
#elif NET6_0
|
||||
var netVersion = "NET 60";
|
||||
#elif NETCOREAPP3_0
|
||||
var netVersion = "CORE 30";
|
||||
var netVersion = "CORE 30";
|
||||
#elif NETCOREAPP3_1
|
||||
var netVersion = "CORE 31";
|
||||
#endif
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ChatBoxViewModel : ViewModelBase
|
||||
#if NET40
|
||||
set => Set(nameof(ChatString), ref _chatString, value);
|
||||
#else
|
||||
set => Set(ref _chatString, value);
|
||||
set => Set(ref _chatString, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class InteractiveDialogViewModel : ViewModelBase, IDialogResultable<strin
|
||||
#if NET40
|
||||
set => Set(nameof(Result), ref _result, value);
|
||||
#else
|
||||
set => Set(ref _result, value);
|
||||
set => Set(ref _result, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class InteractiveDialogViewModel : ViewModelBase, IDialogResultable<strin
|
||||
#if NET40
|
||||
set => Set(nameof(Message), ref _message, value);
|
||||
#else
|
||||
set => Set(ref _message, value);
|
||||
set => Set(ref _message, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -20,11 +20,11 @@ public class AutoCompleteTextBoxDemoViewModel : ViewModelBase
|
||||
FilterItems(value);
|
||||
}
|
||||
#else
|
||||
set
|
||||
{
|
||||
Set(ref _searchText, value);
|
||||
FilterItems(value);
|
||||
}
|
||||
set
|
||||
{
|
||||
Set(ref _searchText, value);
|
||||
FilterItems(value);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public class BadgeDemoViewModel : ViewModelBase
|
||||
#if NET40
|
||||
set => Set(nameof(Count), ref _count, value);
|
||||
#else
|
||||
set => Set(ref _count, value);
|
||||
set => Set(ref _count, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class DialogDemoViewModel : ViewModelBase
|
||||
#if NET40
|
||||
set => Set(nameof(DialogResult), ref _dialogResult, value);
|
||||
#else
|
||||
set => Set(ref _dialogResult, value);
|
||||
set => Set(ref _dialogResult, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -58,21 +58,21 @@ public class DialogDemoViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
#else
|
||||
public RelayCommand<bool> ShowInteractiveDialogCmd => new(async withTimer => await ShowInteractiveDialog(withTimer));
|
||||
public RelayCommand<bool> ShowInteractiveDialogCmd => new(async withTimer => await ShowInteractiveDialog(withTimer));
|
||||
|
||||
private async Task ShowInteractiveDialog(bool withTimer)
|
||||
private async Task ShowInteractiveDialog(bool withTimer)
|
||||
{
|
||||
if (!withTimer)
|
||||
{
|
||||
if (!withTimer)
|
||||
{
|
||||
DialogResult = await Dialog.Show<InteractiveDialog>()
|
||||
.Initialize<InteractiveDialogViewModel>(vm => vm.Message = DialogResult)
|
||||
.GetResultAsync<string>();
|
||||
}
|
||||
else
|
||||
{
|
||||
await Dialog.Show<TextDialogWithTimer>(MessageToken.MainWindow).GetResultAsync<string>();
|
||||
}
|
||||
DialogResult = await Dialog.Show<InteractiveDialog>()
|
||||
.Initialize<InteractiveDialogViewModel>(vm => vm.Message = DialogResult)
|
||||
.GetResultAsync<string>();
|
||||
}
|
||||
else
|
||||
{
|
||||
await Dialog.Show<TextDialogWithTimer>(MessageToken.MainWindow).GetResultAsync<string>();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public RelayCommand NewWindowCmd => new(() => new DialogDemoWindow
|
||||
|
||||
@@ -18,7 +18,7 @@ public class NotificationDemoViewModel : ViewModelBase
|
||||
#if NET40
|
||||
set => Set(nameof(ShowAnimation) ,ref _showAnimation, value);
|
||||
#else
|
||||
set => Set(ref _showAnimation, value);
|
||||
set => Set(ref _showAnimation, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class NotificationDemoViewModel : ViewModelBase
|
||||
#if NET40
|
||||
set => Set(nameof(StaysOpen) ,ref _staysOpen, value);
|
||||
#else
|
||||
set => Set(ref _staysOpen, value);
|
||||
set => Set(ref _staysOpen, value);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class StepBarDemoViewModel : DemoViewModelBase<StepBarDemoModel>
|
||||
#if NET40
|
||||
set => Set(nameof(StepIndex), ref _stepIndex, value);
|
||||
#else
|
||||
set => Set(ref _stepIndex, value);
|
||||
set => Set(ref _stepIndex, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public class TagDemoViewModel : ViewModelBase
|
||||
#if NET40
|
||||
set => Set(nameof(TagName), ref _tagName, value);
|
||||
#else
|
||||
set => Set(ref _tagName, value);
|
||||
set => Set(ref _tagName, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public class DemoViewModelBase<T> : ViewModelBase
|
||||
#if NET40
|
||||
set => Set(nameof(DataList), ref _dataList, value);
|
||||
#else
|
||||
set => Set(ref _dataList, value);
|
||||
set => Set(ref _dataList, value);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public class MainViewModel : DemoViewModelBase<DemoDataModel>
|
||||
#if NET40
|
||||
set => Set(nameof(SubContent), ref _subContent, value);
|
||||
#else
|
||||
set => Set(ref _subContent, value);
|
||||
set => Set(ref _subContent, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class MainViewModel : DemoViewModelBase<DemoDataModel>
|
||||
#if NET40
|
||||
set => Set(nameof(ContentTitle), ref _contentTitle, value);
|
||||
#else
|
||||
set => Set(ref _contentTitle, value);
|
||||
set => Set(ref _contentTitle, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public class MainViewModel : DemoViewModelBase<DemoDataModel>
|
||||
#if NET40
|
||||
Task.Factory.StartNew(() =>
|
||||
#else
|
||||
Task.Run(() =>
|
||||
Task.Run(() =>
|
||||
#endif
|
||||
{
|
||||
DataList = _dataService.GetDemoDataList();
|
||||
|
||||
@@ -30,7 +30,7 @@ public class NonClientAreaViewModel : ViewModelBase
|
||||
#if NET40
|
||||
set => Set(nameof(VersionInfo), ref _versionInfo, value);
|
||||
#else
|
||||
set => Set(ref _versionInfo, value);
|
||||
set => Set(ref _versionInfo, value);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class ComboBox : System.Windows.Controls.ComboBox, IDataInput
|
||||
|
||||
_editableTextBox.SetBinding(SelectionBrushProperty, new Binding(SelectionBrushProperty.Name) { Source = this });
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
_editableTextBox.SetBinding(SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
_editableTextBox.SetBinding(SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
#endif
|
||||
_editableTextBox.SetBinding(SelectionOpacityProperty, new Binding(SelectionOpacityProperty.Name) { Source = this });
|
||||
_editableTextBox.SetBinding(CaretBrushProperty, new Binding(CaretBrushProperty.Name) { Source = this });
|
||||
@@ -93,7 +93,7 @@ public class ComboBox : System.Windows.Controls.ComboBox, IDataInput
|
||||
UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
|
||||
Mode = BindingMode.OneWayToSource,
|
||||
#if !NET40
|
||||
Delay = 500,
|
||||
Delay = 500,
|
||||
#endif
|
||||
Source = this
|
||||
});
|
||||
@@ -128,12 +128,12 @@ public class ComboBox : System.Windows.Controls.ComboBox, IDataInput
|
||||
}
|
||||
|
||||
#if !NET40
|
||||
protected override void OnDropDownClosed(EventArgs e)
|
||||
{
|
||||
base.OnDropDownClosed(e);
|
||||
protected override void OnDropDownClosed(EventArgs e)
|
||||
{
|
||||
base.OnDropDownClosed(e);
|
||||
|
||||
_isAutoCompleteAction = false;
|
||||
}
|
||||
_isAutoCompleteAction = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
private void EditableTextBox_GotFocus(object sender, RoutedEventArgs e)
|
||||
@@ -271,7 +271,7 @@ public class ComboBox : System.Windows.Controls.ComboBox, IDataInput
|
||||
ctl._autoCompleteTimer.Stop();
|
||||
ctl._autoCompleteTimer.Start();
|
||||
#else
|
||||
ctl.UpdateSearchItems(e.NewValue as string);
|
||||
ctl.UpdateSearchItems(e.NewValue as string);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -298,14 +298,14 @@ public class ComboBox : System.Windows.Controls.ComboBox, IDataInput
|
||||
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(ComboBox));
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(ComboBox));
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class DatePicker : System.Windows.Controls.DatePicker, IDataInput
|
||||
{
|
||||
_textBox.SetBinding(SelectionBrushProperty, new Binding(SelectionBrushProperty.Name) { Source = this });
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
_textBox.SetBinding(SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
_textBox.SetBinding(SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
#endif
|
||||
_textBox.SetBinding(SelectionOpacityProperty, new Binding(SelectionOpacityProperty.Name) { Source = this });
|
||||
_textBox.SetBinding(CaretBrushProperty, new Binding(CaretBrushProperty.Name) { Source = this });
|
||||
@@ -100,14 +100,14 @@ public class DatePicker : System.Windows.Controls.DatePicker, IDataInput
|
||||
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(DatePicker));
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(DatePicker));
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -289,14 +289,14 @@ public class DateTimePicker : Control, IDataInput
|
||||
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(DateTimePicker));
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(DateTimePicker));
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -378,7 +378,7 @@ public class DateTimePicker : Control, IDataInput
|
||||
|
||||
_textBox.SetBinding(SelectionBrushProperty, new Binding(SelectionBrushProperty.Name) { Source = this });
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
_textBox.SetBinding(SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
_textBox.SetBinding(SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
#endif
|
||||
_textBox.SetBinding(SelectionOpacityProperty, new Binding(SelectionOpacityProperty.Name) { Source = this });
|
||||
_textBox.SetBinding(CaretBrushProperty, new Binding(CaretBrushProperty.Name) { Source = this });
|
||||
@@ -542,29 +542,29 @@ public class DateTimePicker : Control, IDataInput
|
||||
switch (e.Key)
|
||||
{
|
||||
case Key.System:
|
||||
{
|
||||
switch (e.SystemKey)
|
||||
{
|
||||
case Key.Down:
|
||||
switch (e.SystemKey)
|
||||
{
|
||||
if ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt)
|
||||
{
|
||||
TogglePopup();
|
||||
return true;
|
||||
}
|
||||
case Key.Down:
|
||||
{
|
||||
if ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt)
|
||||
{
|
||||
TogglePopup();
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case Key.Enter:
|
||||
{
|
||||
SetSelectedDateTime();
|
||||
return true;
|
||||
}
|
||||
{
|
||||
SetSelectedDateTime();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -53,7 +53,7 @@ public class NumericUpDown : Control
|
||||
{
|
||||
_textBox.SetBinding(SelectionBrushProperty, new Binding(SelectionBrushProperty.Name) { Source = this });
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
_textBox.SetBinding(SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
_textBox.SetBinding(SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
#endif
|
||||
_textBox.SetBinding(SelectionOpacityProperty, new Binding(SelectionOpacityProperty.Name) { Source = this });
|
||||
_textBox.SetBinding(CaretBrushProperty, new Binding(CaretBrushProperty.Name) { Source = this });
|
||||
@@ -311,14 +311,14 @@ public class NumericUpDown : Control
|
||||
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(NumericUpDown));
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(NumericUpDown));
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -160,14 +160,14 @@ public class PasswordBox : Control, IDataInput
|
||||
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(PasswordBox));
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(PasswordBox));
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -191,10 +191,10 @@ public class PasswordBox : Control, IDataInput
|
||||
|
||||
#if !NET40
|
||||
|
||||
public static readonly DependencyProperty IsSelectionActiveProperty =
|
||||
TextBoxBase.IsSelectionActiveProperty.AddOwner(typeof(PasswordBox));
|
||||
public static readonly DependencyProperty IsSelectionActiveProperty =
|
||||
TextBoxBase.IsSelectionActiveProperty.AddOwner(typeof(PasswordBox));
|
||||
|
||||
public bool IsSelectionActive => ActualPasswordBox != null && (bool) ActualPasswordBox.GetValue(IsSelectionActiveProperty);
|
||||
public bool IsSelectionActive => ActualPasswordBox != null && (bool) ActualPasswordBox.GetValue(IsSelectionActiveProperty);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -314,7 +314,7 @@ public class PasswordBox : Control, IDataInput
|
||||
ActualPasswordBox.SetBinding(System.Windows.Controls.PasswordBox.MaxLengthProperty, new Binding(MaxLengthProperty.Name) { Source = this });
|
||||
ActualPasswordBox.SetBinding(System.Windows.Controls.PasswordBox.SelectionBrushProperty, new Binding(SelectionBrushProperty.Name) { Source = this });
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
ActualPasswordBox.SetBinding(System.Windows.Controls.PasswordBox.SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
ActualPasswordBox.SetBinding(System.Windows.Controls.PasswordBox.SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
#endif
|
||||
ActualPasswordBox.SetBinding(System.Windows.Controls.PasswordBox.SelectionOpacityProperty, new Binding(SelectionOpacityProperty.Name) { Source = this });
|
||||
ActualPasswordBox.SetBinding(System.Windows.Controls.PasswordBox.CaretBrushProperty, new Binding(CaretBrushProperty.Name) { Source = this });
|
||||
|
||||
@@ -292,14 +292,14 @@ public class PinBox : Control
|
||||
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(PinBox));
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(PinBox));
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -361,7 +361,7 @@ public class PinBox : Control
|
||||
|
||||
passwordBox.SetBinding(SelectionBrushProperty, new Binding(SelectionBrushProperty.Name) { Source = this });
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
passwordBox.SetBinding(SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
passwordBox.SetBinding(SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
#endif
|
||||
passwordBox.SetBinding(SelectionOpacityProperty, new Binding(SelectionOpacityProperty.Name) { Source = this });
|
||||
passwordBox.SetBinding(CaretBrushProperty, new Binding(CaretBrushProperty.Name) { Source = this });
|
||||
|
||||
@@ -311,14 +311,14 @@ public class TimePicker : Control, IDataInput
|
||||
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(TimePicker));
|
||||
public static readonly DependencyProperty SelectionTextBrushProperty =
|
||||
TextBoxBase.SelectionTextBrushProperty.AddOwner(typeof(TimePicker));
|
||||
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
public Brush SelectionTextBrush
|
||||
{
|
||||
get => (Brush) GetValue(SelectionTextBrushProperty);
|
||||
set => SetValue(SelectionTextBrushProperty, value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -473,7 +473,7 @@ public class TimePicker : Control, IDataInput
|
||||
|
||||
_textBox.SetBinding(SelectionBrushProperty, new Binding(SelectionBrushProperty.Name) { Source = this });
|
||||
#if !(NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472)
|
||||
_textBox.SetBinding(SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
_textBox.SetBinding(SelectionTextBrushProperty, new Binding(SelectionTextBrushProperty.Name) { Source = this });
|
||||
#endif
|
||||
_textBox.SetBinding(SelectionOpacityProperty, new Binding(SelectionOpacityProperty.Name) { Source = this });
|
||||
_textBox.SetBinding(CaretBrushProperty, new Binding(CaretBrushProperty.Name) { Source = this });
|
||||
@@ -574,29 +574,29 @@ public class TimePicker : Control, IDataInput
|
||||
switch (e.Key)
|
||||
{
|
||||
case Key.System:
|
||||
{
|
||||
switch (e.SystemKey)
|
||||
{
|
||||
case Key.Down:
|
||||
switch (e.SystemKey)
|
||||
{
|
||||
if ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt)
|
||||
{
|
||||
TogglePopup();
|
||||
return true;
|
||||
}
|
||||
case Key.Down:
|
||||
{
|
||||
if ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt)
|
||||
{
|
||||
TogglePopup();
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case Key.Enter:
|
||||
{
|
||||
SetSelectedTime();
|
||||
return true;
|
||||
}
|
||||
{
|
||||
SetSelectedTime();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -97,31 +97,31 @@ public sealed class Notification : System.Windows.Window
|
||||
case ShowAnimation.None:
|
||||
break;
|
||||
case ShowAnimation.HorizontalMove:
|
||||
{
|
||||
var animation = AnimationHelper.CreateAnimation(desktopWorkingArea.Width);
|
||||
animation.Completed += Animation_Completed;
|
||||
BeginAnimation(LeftProperty, animation);
|
||||
e.Cancel = true;
|
||||
_shouldBeClosed = true;
|
||||
}
|
||||
{
|
||||
var animation = AnimationHelper.CreateAnimation(desktopWorkingArea.Width);
|
||||
animation.Completed += Animation_Completed;
|
||||
BeginAnimation(LeftProperty, animation);
|
||||
e.Cancel = true;
|
||||
_shouldBeClosed = true;
|
||||
}
|
||||
break;
|
||||
case ShowAnimation.VerticalMove:
|
||||
{
|
||||
var animation = AnimationHelper.CreateAnimation(desktopWorkingArea.Height);
|
||||
animation.Completed += Animation_Completed;
|
||||
BeginAnimation(TopProperty, animation);
|
||||
e.Cancel = true;
|
||||
_shouldBeClosed = true;
|
||||
}
|
||||
{
|
||||
var animation = AnimationHelper.CreateAnimation(desktopWorkingArea.Height);
|
||||
animation.Completed += Animation_Completed;
|
||||
BeginAnimation(TopProperty, animation);
|
||||
e.Cancel = true;
|
||||
_shouldBeClosed = true;
|
||||
}
|
||||
break;
|
||||
case ShowAnimation.Fade:
|
||||
{
|
||||
var animation = AnimationHelper.CreateAnimation(0);
|
||||
animation.Completed += Animation_Completed;
|
||||
BeginAnimation(OpacityProperty, animation);
|
||||
e.Cancel = true;
|
||||
_shouldBeClosed = true;
|
||||
}
|
||||
{
|
||||
var animation = AnimationHelper.CreateAnimation(0);
|
||||
animation.Completed += Animation_Completed;
|
||||
BeginAnimation(OpacityProperty, animation);
|
||||
e.Cancel = true;
|
||||
_shouldBeClosed = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ public class PropertyItemsControl : ListBox
|
||||
public PropertyItemsControl()
|
||||
{
|
||||
#if !NET40
|
||||
VirtualizingPanel.SetIsVirtualizingWhenGrouping(this, true);
|
||||
VirtualizingPanel.SetScrollUnit(this, ScrollUnit.Pixel);
|
||||
VirtualizingPanel.SetIsVirtualizingWhenGrouping(this, true);
|
||||
VirtualizingPanel.SetScrollUnit(this, ScrollUnit.Pixel);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -233,24 +233,24 @@ public class ScreenshotWindow : System.Windows.Window
|
||||
switch (e.Key)
|
||||
{
|
||||
case Key.Left:
|
||||
{
|
||||
MoveTargetArea(MoveRect(_targetWindowRect, -1, rightFlag: -1));
|
||||
}
|
||||
{
|
||||
MoveTargetArea(MoveRect(_targetWindowRect, -1, rightFlag: -1));
|
||||
}
|
||||
break;
|
||||
case Key.Up:
|
||||
{
|
||||
MoveTargetArea(MoveRect(_targetWindowRect, bottomFlag: -1, topFlag: -1));
|
||||
}
|
||||
{
|
||||
MoveTargetArea(MoveRect(_targetWindowRect, bottomFlag: -1, topFlag: -1));
|
||||
}
|
||||
break;
|
||||
case Key.Right:
|
||||
{
|
||||
MoveTargetArea(MoveRect(_targetWindowRect, 1, rightFlag: 1));
|
||||
}
|
||||
{
|
||||
MoveTargetArea(MoveRect(_targetWindowRect, 1, rightFlag: 1));
|
||||
}
|
||||
break;
|
||||
case Key.Down:
|
||||
{
|
||||
MoveTargetArea(MoveRect(_targetWindowRect, bottomFlag: 1, topFlag: 1));
|
||||
}
|
||||
{
|
||||
MoveTargetArea(MoveRect(_targetWindowRect, bottomFlag: 1, topFlag: 1));
|
||||
}
|
||||
break;
|
||||
case Key.Enter:
|
||||
_saveScreenshot = true;
|
||||
|
||||
@@ -86,8 +86,8 @@ public class HighlightTextBlock : TextBlock
|
||||
var sourceText = SourceText;
|
||||
var queries = QueriesText.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var intervals = from query in queries.Distinct()
|
||||
from interval in GetQueryIntervals(sourceText, query)
|
||||
select interval;
|
||||
from interval in GetQueryIntervals(sourceText, query)
|
||||
select interval;
|
||||
var mergedIntervals = MergeIntervals(intervals.ToList());
|
||||
var fragments = SplitTextByOrderedDisjointIntervals(sourceText, mergedIntervals);
|
||||
|
||||
@@ -97,9 +97,9 @@ public class HighlightTextBlock : TextBlock
|
||||
private IEnumerable GenerateRunElement(IEnumerable<Fragment> fragments)
|
||||
{
|
||||
return from item in fragments
|
||||
select item.IsQuery
|
||||
? GetHighlightRun(item.Text)
|
||||
: new Run(item.Text);
|
||||
select item.IsQuery
|
||||
? GetHighlightRun(item.Text)
|
||||
: new Run(item.Text);
|
||||
}
|
||||
|
||||
private Run GetHighlightRun(string highlightText)
|
||||
|
||||
@@ -203,12 +203,12 @@ internal class GlowEdge : HwndWrapper
|
||||
case 169:
|
||||
case 171:
|
||||
case 173:
|
||||
{
|
||||
var targetWindowHandle = TargetWindowHandle;
|
||||
InteropMethods.SendMessage(targetWindowHandle, 6, new IntPtr(2), IntPtr.Zero);
|
||||
InteropMethods.SendMessage(targetWindowHandle, msg, wParam, IntPtr.Zero);
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
{
|
||||
var targetWindowHandle = TargetWindowHandle;
|
||||
InteropMethods.SendMessage(targetWindowHandle, 6, new IntPtr(2), IntPtr.Zero);
|
||||
InteropMethods.SendMessage(targetWindowHandle, msg, wParam, IntPtr.Zero);
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -57,37 +57,37 @@ public class LangExtension : MarkupExtension
|
||||
switch (Key)
|
||||
{
|
||||
case string key:
|
||||
{
|
||||
var binding = CreateLangBinding(key);
|
||||
BindingOperations.SetBinding(targetObject, targetProperty, binding);
|
||||
return binding.ProvideValue(serviceProvider);
|
||||
}
|
||||
{
|
||||
var binding = CreateLangBinding(key);
|
||||
BindingOperations.SetBinding(targetObject, targetProperty, binding);
|
||||
return binding.ProvideValue(serviceProvider);
|
||||
}
|
||||
case Binding keyBinding when targetObject is FrameworkElement element:
|
||||
{
|
||||
if (element.DataContext != null)
|
||||
{
|
||||
var binding = SetLangBinding(element, targetProperty, keyBinding.Path, element.DataContext);
|
||||
return binding.ProvideValue(serviceProvider);
|
||||
if (element.DataContext != null)
|
||||
{
|
||||
var binding = SetLangBinding(element, targetProperty, keyBinding.Path, element.DataContext);
|
||||
return binding.ProvideValue(serviceProvider);
|
||||
}
|
||||
|
||||
SetTargetProperty(element, targetProperty);
|
||||
element.DataContextChanged += LangExtension_DataContextChanged;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
SetTargetProperty(element, targetProperty);
|
||||
element.DataContextChanged += LangExtension_DataContextChanged;
|
||||
|
||||
break;
|
||||
}
|
||||
case Binding keyBinding when targetObject is FrameworkContentElement element:
|
||||
{
|
||||
if (element.DataContext != null)
|
||||
{
|
||||
var binding = SetLangBinding(element, targetProperty, keyBinding.Path, element.DataContext);
|
||||
return binding.ProvideValue(serviceProvider);
|
||||
if (element.DataContext != null)
|
||||
{
|
||||
var binding = SetLangBinding(element, targetProperty, keyBinding.Path, element.DataContext);
|
||||
return binding.ProvideValue(serviceProvider);
|
||||
}
|
||||
|
||||
SetTargetProperty(element, targetProperty);
|
||||
element.DataContextChanged += LangExtension_DataContextChanged;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
SetTargetProperty(element, targetProperty);
|
||||
element.DataContextChanged += LangExtension_DataContextChanged;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
@@ -98,25 +98,25 @@ public class LangExtension : MarkupExtension
|
||||
switch (sender)
|
||||
{
|
||||
case FrameworkElement element:
|
||||
{
|
||||
element.DataContextChanged -= LangExtension_DataContextChanged;
|
||||
if (!(Key is Binding keyBinding)) return;
|
||||
{
|
||||
element.DataContextChanged -= LangExtension_DataContextChanged;
|
||||
if (!(Key is Binding keyBinding)) return;
|
||||
|
||||
var targetProperty = GetTargetProperty(element);
|
||||
SetTargetProperty(element, null);
|
||||
SetLangBinding(element, targetProperty, keyBinding.Path, element.DataContext);
|
||||
break;
|
||||
}
|
||||
var targetProperty = GetTargetProperty(element);
|
||||
SetTargetProperty(element, null);
|
||||
SetLangBinding(element, targetProperty, keyBinding.Path, element.DataContext);
|
||||
break;
|
||||
}
|
||||
case FrameworkContentElement element:
|
||||
{
|
||||
element.DataContextChanged -= LangExtension_DataContextChanged;
|
||||
if (!(Key is Binding keyBinding)) return;
|
||||
{
|
||||
element.DataContextChanged -= LangExtension_DataContextChanged;
|
||||
if (!(Key is Binding keyBinding)) return;
|
||||
|
||||
var targetProperty = GetTargetProperty(element);
|
||||
SetTargetProperty(element, null);
|
||||
SetLangBinding(element, targetProperty, keyBinding.Path, element.DataContext);
|
||||
break;
|
||||
}
|
||||
var targetProperty = GetTargetProperty(element);
|
||||
SetTargetProperty(element, null);
|
||||
SetLangBinding(element, targetProperty, keyBinding.Path, element.DataContext);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,9 +79,9 @@ public class ConfigHelper : INotifyPropertyChanged
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
#else
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -16,12 +16,12 @@ internal class TextHelper
|
||||
typeface,
|
||||
fontSize, Brushes.Black);
|
||||
#else
|
||||
var formattedText = new FormattedText(
|
||||
text,
|
||||
CultureInfo.CurrentUICulture,
|
||||
flowDirection,
|
||||
typeface,
|
||||
fontSize, Brushes.Black, DpiHelper.DeviceDpiX);
|
||||
var formattedText = new FormattedText(
|
||||
text,
|
||||
CultureInfo.CurrentUICulture,
|
||||
flowDirection,
|
||||
typeface,
|
||||
fontSize, Brushes.Black, DpiHelper.DeviceDpiX);
|
||||
#endif
|
||||
|
||||
return formattedText;
|
||||
|
||||
@@ -140,10 +140,10 @@ public static class WindowHelper
|
||||
#if NET40
|
||||
return WindowResizeBorderThickness.Add(new Thickness(autoHide ? -8 : 0));
|
||||
#elif NETCOREAPP
|
||||
var hdc = InteropMethods.GetDC(IntPtr.Zero);
|
||||
var scale = InteropMethods.GetDeviceCaps(hdc, InteropValues.DESKTOPVERTRES) / (float) InteropMethods.GetDeviceCaps(hdc, InteropValues.VERTRES);
|
||||
InteropMethods.ReleaseDC(IntPtr.Zero, hdc);
|
||||
return WindowResizeBorderThickness.Add(new Thickness((autoHide ? -4 : 4) * scale));
|
||||
var hdc = InteropMethods.GetDC(IntPtr.Zero);
|
||||
var scale = InteropMethods.GetDeviceCaps(hdc, InteropValues.DESKTOPVERTRES) / (float) InteropMethods.GetDeviceCaps(hdc, InteropValues.VERTRES);
|
||||
InteropMethods.ReleaseDC(IntPtr.Zero, hdc);
|
||||
return WindowResizeBorderThickness.Add(new Thickness((autoHide ? -4 : 4) * scale));
|
||||
#else
|
||||
return WindowResizeBorderThickness.Add(new Thickness(autoHide ? -4 : 4));
|
||||
#endif
|
||||
|
||||
@@ -45,12 +45,12 @@ public sealed class SketchGeometryEffect : GeometryEffect
|
||||
{
|
||||
var startPoint = pathFigure.StartPoint;
|
||||
foreach (var iteratorVariable1 in pathFigure.AllSegments())
|
||||
foreach (var iteratorVariable2 in iteratorVariable1.PathSegment.GetSimpleSegments(
|
||||
iteratorVariable1.StartPoint))
|
||||
{
|
||||
yield return iteratorVariable2;
|
||||
startPoint = iteratorVariable2.Points.Last();
|
||||
}
|
||||
foreach (var iteratorVariable2 in iteratorVariable1.PathSegment.GetSimpleSegments(
|
||||
iteratorVariable1.StartPoint))
|
||||
{
|
||||
yield return iteratorVariable2;
|
||||
startPoint = iteratorVariable2.Points.Last();
|
||||
}
|
||||
|
||||
if (pathFigure.IsClosed) yield return SimpleSegment.Create(startPoint, pathFigure.StartPoint);
|
||||
}
|
||||
|
||||
@@ -603,7 +603,7 @@ internal static class Utility
|
||||
urlDecoder.AddChar(c);
|
||||
}
|
||||
}
|
||||
IL_12D:;
|
||||
IL_12D:;
|
||||
}
|
||||
return urlDecoder.GetString();
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public class SystemParameters2 : INotifyPropertyChanged
|
||||
}
|
||||
}
|
||||
windowCornerRadius = new CornerRadius(0.0);
|
||||
IL_E6:
|
||||
IL_E6:
|
||||
this.WindowCornerRadius = windowCornerRadius;
|
||||
}
|
||||
|
||||
|
||||
@@ -506,7 +506,7 @@ public sealed class TaskbarItemInfo : Freezable
|
||||
default:
|
||||
goto IL_A5;
|
||||
}
|
||||
IL_146:
|
||||
IL_146:
|
||||
array[(int) ((UIntPtr) num)] = thumbbutton;
|
||||
num += 1u;
|
||||
if (num != 7u)
|
||||
@@ -514,7 +514,7 @@ public sealed class TaskbarItemInfo : Freezable
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
IL_A5:
|
||||
IL_A5:
|
||||
thumbbutton.szTip = (thumbButtonInfo.Description ?? "");
|
||||
thumbbutton.hIcon = this._GetHICONFromImageSource(thumbButtonInfo.ImageSource, this._overlaySize);
|
||||
if (!thumbButtonInfo.IsBackgroundVisible)
|
||||
@@ -542,7 +542,7 @@ public sealed class TaskbarItemInfo : Freezable
|
||||
}
|
||||
goto IL_1AE;
|
||||
}
|
||||
IL_179:
|
||||
IL_179:
|
||||
array[(int) ((UIntPtr) num)] = new THUMBBUTTON
|
||||
{
|
||||
iId = num,
|
||||
@@ -550,7 +550,7 @@ public sealed class TaskbarItemInfo : Freezable
|
||||
dwMask = (THB.ICON | THB.TOOLTIP | THB.FLAGS)
|
||||
};
|
||||
num += 1u;
|
||||
IL_1AE:
|
||||
IL_1AE:
|
||||
if (num < 7u)
|
||||
{
|
||||
goto IL_179;
|
||||
|
||||
Reference in new issue
Block a user