diff --git a/BrightSharp/AssemblyInfo.cs b/BrightSharp/AssemblyInfo.cs new file mode 100644 index 0000000..107498e --- /dev/null +++ b/BrightSharp/AssemblyInfo.cs @@ -0,0 +1,26 @@ +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows; +using System.Windows.Markup; + +[assembly: AssemblyDescription("")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, + ResourceDictionaryLocation.SourceAssembly +)] + +[assembly: XmlnsPrefix("http://schemas.brightsharp.com/developer", "bs")] +[assembly: XmlnsDefinition("http://schemas.brightsharp.com/developer", "BrightSharp")] +[assembly: XmlnsDefinition("http://schemas.brightsharp.com/developer", "BrightSharp.Extensions")] +[assembly: XmlnsDefinition("http://schemas.brightsharp.com/developer", "BrightSharp.Behaviors")] +[assembly: XmlnsDefinition("http://schemas.brightsharp.com/developer", "BrightSharp.Converters")] +[assembly: XmlnsPrefix("http://schemas.brightsharp.com/diagrams", "bsDiag")] +[assembly: XmlnsDefinition("http://schemas.brightsharp.com/diagrams", "BrightSharp.Diagrams")] diff --git a/BrightSharp/Behaviors/FilterDefaultViewTextBoxBehavior.cs b/BrightSharp/Behaviors/FilterDefaultViewTextBoxBehavior.cs index 688db6c..b0850dd 100644 --- a/BrightSharp/Behaviors/FilterDefaultViewTextBoxBehavior.cs +++ b/BrightSharp/Behaviors/FilterDefaultViewTextBoxBehavior.cs @@ -1,29 +1,31 @@ -using System; +using Microsoft.Xaml.Behaviors; +using System; using System.Collections; using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Data; -using System.Windows.Interactivity; using System.Windows.Threading; namespace BrightSharp.Behaviors { public class FilterDefaultViewTextBoxBehavior : Behavior { - DispatcherTimer timer = new DispatcherTimer(); + readonly DispatcherTimer _timer = new DispatcherTimer(); + public FilterDefaultViewTextBoxBehavior() { - timer.Tick += Timer_Tick; + _timer.Tick += Timer_Tick; FilterDelay = TimeSpan.FromSeconds(1); IgnoreCase = null; //Case sensitive if any char upper case FilterStringPropertyName = "FilterString"; + } private void Timer_Tick(object sender, EventArgs e) { - timer.Stop(); + _timer.Stop(); if (ItemsSource != null) { var view = CollectionViewSource.GetDefaultView(ItemsSource); @@ -90,7 +92,7 @@ namespace BrightSharp.Behaviors public Predicate CustomFilter { get; set; } - public TimeSpan FilterDelay { get { return timer.Interval; } set { timer.Interval = value; } } + public TimeSpan FilterDelay { get { return _timer.Interval; } set { _timer.Interval = value; } } protected override void OnAttached() { @@ -101,14 +103,14 @@ namespace BrightSharp.Behaviors private void AssociatedObject_TextChanged(object sender, TextChangedEventArgs e) { - timer.Stop(); timer.Start(); + _timer.Stop(); _timer.Start(); HasFilterText = !string.IsNullOrEmpty(AssociatedObject.Text); } protected override void OnDetaching() { AssociatedObject.TextChanged -= AssociatedObject_TextChanged; - timer.Tick -= Timer_Tick; + _timer.Tick -= Timer_Tick; base.OnDetaching(); } } diff --git a/BrightSharp/Behaviors/MinMaxSize_Logic.cs b/BrightSharp/Behaviors/MinMaxSize_Logic.cs index 55329fd..eba48ce 100644 --- a/BrightSharp/Behaviors/MinMaxSize_Logic.cs +++ b/BrightSharp/Behaviors/MinMaxSize_Logic.cs @@ -2,6 +2,7 @@ using BrightSharp.Interop.Constants; using BrightSharp.Interop.Structures; using System; +using System.Diagnostics; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Interop; @@ -38,6 +39,7 @@ namespace BrightSharp.Behaviors } } + [DebuggerStepThrough] private IntPtr WindowProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { switch (msg) diff --git a/BrightSharp/Behaviors/SelectAllTextOnFocusBehavior.cs b/BrightSharp/Behaviors/SelectAllTextOnFocusBehavior.cs index 74192bd..51cfaff 100644 --- a/BrightSharp/Behaviors/SelectAllTextOnFocusBehavior.cs +++ b/BrightSharp/Behaviors/SelectAllTextOnFocusBehavior.cs @@ -1,6 +1,6 @@ -using System.Windows.Controls.Primitives; +using Microsoft.Xaml.Behaviors; +using System.Windows.Controls.Primitives; using System.Windows.Input; -using System.Windows.Interactivity; namespace BrightSharp.Behaviors { diff --git a/BrightSharp/Behaviors/WindowMinMaxSizeBehavior.cs b/BrightSharp/Behaviors/WindowMinMaxSizeBehavior.cs index a578b89..90b9da7 100644 --- a/BrightSharp/Behaviors/WindowMinMaxSizeBehavior.cs +++ b/BrightSharp/Behaviors/WindowMinMaxSizeBehavior.cs @@ -1,23 +1,22 @@ -using System.Windows; -using System.Windows.Interactivity; -using System.Windows.Interop; +using Microsoft.Xaml.Behaviors; +using System.Windows; namespace BrightSharp.Behaviors { public class WindowMinMaxSizeBehavior : Behavior { - private MinMaxSize_Logic logic; + private MinMaxSize_Logic _logic; protected override void OnAttached() { base.OnAttached(); - logic = new MinMaxSize_Logic(AssociatedObject); - logic.OnAttached(); + _logic = new MinMaxSize_Logic(AssociatedObject); + _logic.OnAttached(); } protected override void OnDetaching() { - logic.OnDetaching(); + _logic.OnDetaching(); base.OnDetaching(); } } diff --git a/BrightSharp/BrightSharp.csproj b/BrightSharp/BrightSharp.csproj index 29dbf80..a38c6d0 100644 --- a/BrightSharp/BrightSharp.csproj +++ b/BrightSharp/BrightSharp.csproj @@ -1,218 +1,74 @@ - - - + + - Debug - AnyCPU - {ACC3C556-F8E4-4F2A-A23D-8E8749679A1B} - library - Properties - BrightSharp - BrightSharp - v4.5 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - true - bin\x64\Debug\ - DEBUG;TRACE - full - x64 - prompt - MinimumRecommendedRules.ruleset - - - bin\x64\Release\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - prompt - MinimumRecommendedRules.ruleset + net5.0-windows + true + AnyCPU;x64 + - - - - G:\repositories\Tps.Next\packages\System.Windows.Interactivity.WPF.2.0.20525\lib\net40\System.Windows.Interactivity.dll - - - - - - - - 4.0 - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - Theme.xaml - - - - Code - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - - Theme.Static.xaml - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - SettingsSingleFileGenerator - Settings.Designer.cs - - + + - - - - - - \ No newline at end of file + + + + Code + + + Theme.xaml + + + + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + + diff --git a/BrightSharp/Commands/RelayCommand.cs b/BrightSharp/Commands/RelayCommand.cs index 0ab460d..1c13498 100644 --- a/BrightSharp/Commands/RelayCommand.cs +++ b/BrightSharp/Commands/RelayCommand.cs @@ -21,6 +21,11 @@ namespace BrightSharp.Commands _canExecuteEvaluator = canExecuteEvaluator; } + public RelayCommand(Action methodToExecute) + { + _methodToExecute = methodToExecute; + } + public bool CanExecute(object parameter) { if (_canExecuteEvaluator == null) @@ -35,7 +40,7 @@ namespace BrightSharp.Commands } } - public class RelayCommand : ICommand + public class RelayCommand : ICommand where T : class { private readonly Action _methodToExecuteWithParam; private readonly Func _canExecuteEvaluator; @@ -56,11 +61,11 @@ namespace BrightSharp.Commands { if (_canExecuteEvaluator == null) return true; - return _canExecuteEvaluator.Invoke((T)parameter); + return _canExecuteEvaluator.Invoke(parameter as T); } public void Execute(object parameter) { - _methodToExecuteWithParam?.Invoke((T)parameter); + _methodToExecuteWithParam?.Invoke(parameter as T); } } } diff --git a/BrightSharp/Themes/Style.Classic.xaml b/BrightSharp/Themes/Style.Classic.xaml index 02648d2..b299435 100644 --- a/BrightSharp/Themes/Style.Classic.xaml +++ b/BrightSharp/Themes/Style.Classic.xaml @@ -212,11 +212,10 @@ - + Black - @@ -229,10 +228,9 @@ + #E0E0EA Black - - #DEE4FF - #FFB6B6B6 + #FAE0A0 #FFFFFFFF #FFC5C5C5 #FF6B6B6B @@ -240,6 +238,9 @@ #FF47909B #D6D6D6 #E6E6E6 + + + @@ -247,15 +248,16 @@ - + - + + - - + + diff --git a/BrightSharp/Themes/Style.DevLab.xaml b/BrightSharp/Themes/Style.DevLab.xaml index 429b83c..4f6422d 100644 --- a/BrightSharp/Themes/Style.DevLab.xaml +++ b/BrightSharp/Themes/Style.DevLab.xaml @@ -224,7 +224,7 @@ #E3E3E3 - #FFB6B6B6 + #FFD6E6E6 #FFFFFFFF #FFC5C5C5 #FF6B6B6B diff --git a/BrightSharp/Themes/Theme.cs b/BrightSharp/Themes/Theme.cs index 1929326..219a1a3 100644 --- a/BrightSharp/Themes/Theme.cs +++ b/BrightSharp/Themes/Theme.cs @@ -36,7 +36,5 @@ namespace BrightSharp.Themes var window = Window.GetWindow((DependencyObject)sender); window.WindowState = WindowState.Minimized; } - - } } diff --git a/BrightSharp/Themes/Theme.xaml b/BrightSharp/Themes/Theme.xaml index 29be1b8..d32d396 100644 --- a/BrightSharp/Themes/Theme.xaml +++ b/BrightSharp/Themes/Theme.xaml @@ -17,10 +17,10 @@ + - - + @@ -2440,7 +2440,7 @@ - - - - - -