From d8deca56f18a5629bb28ab669ced92a0c11851c7 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 27 Apr 2022 19:39:17 +0300 Subject: [PATCH 01/10] Remove context menu visibility --- src/Themes/ThemeStyles.axaml | 67 ++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/src/Themes/ThemeStyles.axaml b/src/Themes/ThemeStyles.axaml index ae49362..3424776 100644 --- a/src/Themes/ThemeStyles.axaml +++ b/src/Themes/ThemeStyles.axaml @@ -1,5 +1,5 @@ @@ -63,6 +63,25 @@ + + + + + + + + + - + + + + + + + + + + + + + + + + + + diff --git a/Demos/NP.DataGridFilteringNonRemovableDemo/MainWindow.axaml.cs b/Demos/NP.DataGridFilteringNonRemovableDemo/MainWindow.axaml.cs new file mode 100644 index 0000000..45cae0e --- /dev/null +++ b/Demos/NP.DataGridFilteringNonRemovableDemo/MainWindow.axaml.cs @@ -0,0 +1,27 @@ +using Avalonia; +using Avalonia.Collections; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace NP.DataGridFilteringDemo +{ + public partial class MainWindow : Window + { + public People ThePeople { get; } = new People(); + + public MainWindow() + { + InitializeComponent(); +#if DEBUG + this.AttachDevTools(); +#endif + } + + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } + + } +} diff --git a/Demos/NP.DataGridFilteringNonRemovableDemo/NP.DataGridFilteringNonRemovableDemo.csproj b/Demos/NP.DataGridFilteringNonRemovableDemo/NP.DataGridFilteringNonRemovableDemo.csproj new file mode 100644 index 0000000..a3f3ab7 --- /dev/null +++ b/Demos/NP.DataGridFilteringNonRemovableDemo/NP.DataGridFilteringNonRemovableDemo.csproj @@ -0,0 +1,15 @@ + + + WinExe + net5.0 + enable + + + + + + + + + + diff --git a/Demos/NP.DataGridFilteringNonRemovableDemo/NP.DataGridFilteringNonRemovableDemo.sln b/Demos/NP.DataGridFilteringNonRemovableDemo/NP.DataGridFilteringNonRemovableDemo.sln new file mode 100644 index 0000000..2b943f3 --- /dev/null +++ b/Demos/NP.DataGridFilteringNonRemovableDemo/NP.DataGridFilteringNonRemovableDemo.sln @@ -0,0 +1,56 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32126.317 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NP.DataGridFilteringNonRemovableDemo", "NP.DataGridFilteringNonRemovableDemo.csproj", "{A2246463-2A6C-48AF-B222-3119DFCCA002}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{7C66664B-49F1-40D5-91B9-E6FF81D61A4B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NP.Utilities", "..\..\SubModules\NP.Utilities\src\NP.Utilities.csproj", "{BD0ECD36-3D6B-4509-8470-B1C3237863C3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NP.Concepts.Behaviors", "..\..\SubModules\NP.Concepts.Behaviors\src\NP.Concepts.Behaviors.csproj", "{7DC58F6A-53DB-4659-B042-4E22DAF7F951}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NP.Avalonia.Visuals", "..\..\src\NP.Avalonia.Visuals.csproj", "{D1594D3F-6B0F-45F8-8A4A-8906DE05B08C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NP.ViewModelInterfaces", "..\..\SubModules\NP.ViewModelInterfaces\src\NP.ViewModelInterfaces.csproj", "{E749AB2C-DA70-4F39-9424-2371DCE52BD8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A2246463-2A6C-48AF-B222-3119DFCCA002}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A2246463-2A6C-48AF-B222-3119DFCCA002}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A2246463-2A6C-48AF-B222-3119DFCCA002}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2246463-2A6C-48AF-B222-3119DFCCA002}.Release|Any CPU.Build.0 = Release|Any CPU + {BD0ECD36-3D6B-4509-8470-B1C3237863C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD0ECD36-3D6B-4509-8470-B1C3237863C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD0ECD36-3D6B-4509-8470-B1C3237863C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD0ECD36-3D6B-4509-8470-B1C3237863C3}.Release|Any CPU.Build.0 = Release|Any CPU + {7DC58F6A-53DB-4659-B042-4E22DAF7F951}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7DC58F6A-53DB-4659-B042-4E22DAF7F951}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7DC58F6A-53DB-4659-B042-4E22DAF7F951}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7DC58F6A-53DB-4659-B042-4E22DAF7F951}.Release|Any CPU.Build.0 = Release|Any CPU + {D1594D3F-6B0F-45F8-8A4A-8906DE05B08C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D1594D3F-6B0F-45F8-8A4A-8906DE05B08C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D1594D3F-6B0F-45F8-8A4A-8906DE05B08C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D1594D3F-6B0F-45F8-8A4A-8906DE05B08C}.Release|Any CPU.Build.0 = Release|Any CPU + {E749AB2C-DA70-4F39-9424-2371DCE52BD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E749AB2C-DA70-4F39-9424-2371DCE52BD8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E749AB2C-DA70-4F39-9424-2371DCE52BD8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E749AB2C-DA70-4F39-9424-2371DCE52BD8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {BD0ECD36-3D6B-4509-8470-B1C3237863C3} = {7C66664B-49F1-40D5-91B9-E6FF81D61A4B} + {7DC58F6A-53DB-4659-B042-4E22DAF7F951} = {7C66664B-49F1-40D5-91B9-E6FF81D61A4B} + {E749AB2C-DA70-4F39-9424-2371DCE52BD8} = {7C66664B-49F1-40D5-91B9-E6FF81D61A4B} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E35FFBC9-82C7-4434-A583-A3FACEDA9A99} + EndGlobalSection +EndGlobal diff --git a/Demos/NP.DataGridFilteringNonRemovableDemo/People.cs b/Demos/NP.DataGridFilteringNonRemovableDemo/People.cs new file mode 100644 index 0000000..8d4d40c --- /dev/null +++ b/Demos/NP.DataGridFilteringNonRemovableDemo/People.cs @@ -0,0 +1,20 @@ +using System.Collections.ObjectModel; + +namespace NP.DataGridFilteringDemo +{ + public class People : ObservableCollection + { + public void AddPerson(string firstName, string lastName) + { + this.Add(new Person { FirstName = firstName, LastName = lastName }); + } + + public People() + { + AddPerson("John", "Plantagenet"); + AddPerson("Richard", "Plantagenet"); + AddPerson("Henry", "Tudor"); + AddPerson("Elizabeth", "Tudor"); + } + } +} diff --git a/Demos/NP.DataGridFilteringNonRemovableDemo/Person.cs b/Demos/NP.DataGridFilteringNonRemovableDemo/Person.cs new file mode 100644 index 0000000..53cb2a0 --- /dev/null +++ b/Demos/NP.DataGridFilteringNonRemovableDemo/Person.cs @@ -0,0 +1,9 @@ +namespace NP.DataGridFilteringDemo +{ + public class Person + { + public string FirstName { get; set; } + + public string LastName { get; set; } + } +} diff --git a/Demos/NP.DataGridFilteringNonRemovableDemo/Program.cs b/Demos/NP.DataGridFilteringNonRemovableDemo/Program.cs new file mode 100644 index 0000000..3fd37d9 --- /dev/null +++ b/Demos/NP.DataGridFilteringNonRemovableDemo/Program.cs @@ -0,0 +1,21 @@ +using Avalonia; +using System; + +namespace NP.DataGridFilteringDemo +{ + class Program + { + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) => BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() + .LogToTrace(); + } +} diff --git a/Demos/NP.DataGridFilteringNonRemovableDemo/Themes/DarkCrystalTheme.axaml b/Demos/NP.DataGridFilteringNonRemovableDemo/Themes/DarkCrystalTheme.axaml new file mode 100644 index 0000000..df35499 --- /dev/null +++ b/Demos/NP.DataGridFilteringNonRemovableDemo/Themes/DarkCrystalTheme.axaml @@ -0,0 +1,6 @@ + + #FF000000 + #FFF3F3F3 + #FF222222 + diff --git a/Demos/NP.DataGridFilteringNonRemovableDemo/Themes/LightCrystalTheme.axaml b/Demos/NP.DataGridFilteringNonRemovableDemo/Themes/LightCrystalTheme.axaml new file mode 100644 index 0000000..8248358 --- /dev/null +++ b/Demos/NP.DataGridFilteringNonRemovableDemo/Themes/LightCrystalTheme.axaml @@ -0,0 +1,6 @@ + + #FFFFFFFF + #FF0C0C0C + #FFDDDDDD + diff --git a/src/Themes/ThemeStyles.axaml b/src/Themes/ThemeStyles.axaml index 3424776..4c913ca 100644 --- a/src/Themes/ThemeStyles.axaml +++ b/src/Themes/ThemeStyles.axaml @@ -432,33 +432,27 @@ - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + - - + + - - - - + + + + + + + + + + + - + + + + + + + + + From 595fa7756251f6c2f16c3f9c7f1f8e2bf0d204d1 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 7 Dec 2022 17:37:18 +0600 Subject: [PATCH 05/10] Fixed tabulation --- src/Themes/ThemeStyles.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Themes/ThemeStyles.axaml b/src/Themes/ThemeStyles.axaml index d90d19f..77d0dca 100644 --- a/src/Themes/ThemeStyles.axaml +++ b/src/Themes/ThemeStyles.axaml @@ -1,5 +1,5 @@ From 7c55032fd7f977bcec2d0658a90b2a7e7f499480 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 7 Dec 2022 17:38:10 +0600 Subject: [PATCH 06/10] Revert "Fixed tabulation" This reverts commit 595fa7756251f6c2f16c3f9c7f1f8e2bf0d204d1. --- src/Themes/ThemeStyles.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Themes/ThemeStyles.axaml b/src/Themes/ThemeStyles.axaml index 77d0dca..d90d19f 100644 --- a/src/Themes/ThemeStyles.axaml +++ b/src/Themes/ThemeStyles.axaml @@ -1,5 +1,5 @@ From ae277b06b3431aa22fba693a918e40cb507d13e2 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 7 Dec 2022 17:38:13 +0600 Subject: [PATCH 07/10] Revert "Fixed tabulation" This reverts commit 6b377eecb520eb9cc4abccae39a6f4b6441d255f. --- src/Themes/ThemeStyles.axaml | 950 +++++++++++++++++------------------ 1 file changed, 475 insertions(+), 475 deletions(-) diff --git a/src/Themes/ThemeStyles.axaml b/src/Themes/ThemeStyles.axaml index d90d19f..4c913ca 100644 --- a/src/Themes/ThemeStyles.axaml +++ b/src/Themes/ThemeStyles.axaml @@ -1,501 +1,501 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + - - + + - - - - + + + + + + + + + + + - + + + + + + + + + From 66b18e03cbe689eafcb156f3602fc5c790631ce7 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 7 Dec 2022 17:39:05 +0600 Subject: [PATCH 08/10] Fixed tabulation --- src/Themes/ThemeStyles.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Themes/ThemeStyles.axaml b/src/Themes/ThemeStyles.axaml index 4c913ca..f50b9c6 100644 --- a/src/Themes/ThemeStyles.axaml +++ b/src/Themes/ThemeStyles.axaml @@ -1,5 +1,5 @@ From 05e316418d50c1839ea886dde8ad51c0ac24ee17 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 7 Dec 2022 17:41:01 +0600 Subject: [PATCH 09/10] Minor rearrangement --- src/Themes/ThemeStyles.axaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Themes/ThemeStyles.axaml b/src/Themes/ThemeStyles.axaml index f50b9c6..9957a51 100644 --- a/src/Themes/ThemeStyles.axaml +++ b/src/Themes/ThemeStyles.axaml @@ -388,10 +388,9 @@ - From dc9d43fd65f968172f465af2da692bdcd51f6b98 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 7 Dec 2022 17:44:46 +0600 Subject: [PATCH 10/10] Minor rearrangement --- src/Themes/ThemeStyles.axaml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Themes/ThemeStyles.axaml b/src/Themes/ThemeStyles.axaml index 9957a51..fd056b5 100644 --- a/src/Themes/ThemeStyles.axaml +++ b/src/Themes/ThemeStyles.axaml @@ -389,11 +389,11 @@ RowDefinitions="Auto,Auto" Background="{TemplateBinding Background}"> + Background="Transparent" + Name="PART_HeaderColumn" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Margin="{TemplateBinding Padding}">