diff --git a/Masonry.Example/App.config b/Masonry.Example/App.config index 9350691..fd3b410 100644 --- a/Masonry.Example/App.config +++ b/Masonry.Example/App.config @@ -1,7 +1,6 @@ - - + - + - \ No newline at end of file + diff --git a/Masonry.Example/App.xaml b/Masonry.Example/App.xaml index 3b7deca..62fcc0d 100644 --- a/Masonry.Example/App.xaml +++ b/Masonry.Example/App.xaml @@ -3,6 +3,10 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="Shell.xaml"> - + + + + + \ No newline at end of file diff --git a/Masonry.Example/Masonry.Example.csproj b/Masonry.Example/Masonry.Example.csproj index de4d39f..263cfed 100644 --- a/Masonry.Example/Masonry.Example.csproj +++ b/Masonry.Example/Masonry.Example.csproj @@ -1,128 +1,19 @@ - - - + + - Debug - AnyCPU - {0ACC6BCC-EEC0-4E97-AF52-060FDB7E4DC2} WinExe - Properties - Masonry.Example - Masonry.Example - v4.6 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - + net9.0-windows + disable + enable + true - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\Masonry\bin\Debug\Masonry.dll - - - ..\packages\Prism.Core.6.1.0\lib\net45\Prism.dll - True - - - ..\packages\Prism.Wpf.6.1.0\lib\net45\Prism.Wpf.dll - True - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - - - - Shell.xaml - - - - MainView.xaml - - - App.xaml - Code - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - + - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - default.licenseheader - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - + + - + - - - - \ No newline at end of file + + diff --git a/Masonry.Example/Properties/AssemblyInfo.cs b/Masonry.Example/Properties/AssemblyInfo.cs index 4d4951d..62edf63 100644 --- a/Masonry.Example/Properties/AssemblyInfo.cs +++ b/Masonry.Example/Properties/AssemblyInfo.cs @@ -28,15 +28,6 @@ You should have received a copy of the GNU General Public License // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Masonry.Example")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Masonry.Example")] -[assembly: AssemblyCopyright("Copyright © 2016 by Nikita Bernthaler")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. @@ -59,17 +50,3 @@ You should have received a copy of the GNU General Public License //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Masonry.Example/Properties/Resources.Designer.cs b/Masonry.Example/Properties/Resources.Designer.cs deleted file mode 100644 index de53592..0000000 --- a/Masonry.Example/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Masonry.Example.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Masonry.Example.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/Masonry.Example/Properties/Resources.resx b/Masonry.Example/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/Masonry.Example/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Masonry.Example/Properties/Settings.Designer.cs b/Masonry.Example/Properties/Settings.Designer.cs deleted file mode 100644 index 3c6c0fc..0000000 --- a/Masonry.Example/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Masonry.Example.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/Masonry.Example/Properties/Settings.settings b/Masonry.Example/Properties/Settings.settings deleted file mode 100644 index c14891b..0000000 --- a/Masonry.Example/Properties/Settings.settings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/Masonry.Example/ViewModels/MainViewModel.cs b/Masonry.Example/ViewModels/MainViewModel.cs index 1a369ba..ebe6ec6 100644 --- a/Masonry.Example/ViewModels/MainViewModel.cs +++ b/Masonry.Example/ViewModels/MainViewModel.cs @@ -24,6 +24,7 @@ namespace Masonry.Example.ViewModels { using System; using System.Collections.ObjectModel; + using System.Mvvm; using System.Windows; using System.Windows.Controls; using System.Windows.Input; @@ -31,10 +32,7 @@ namespace Masonry.Example.ViewModels using Masonry.Example.Common; - using Prism.Commands; - using Prism.Mvvm; - - internal class MainViewModel : BindableBase + internal class MainViewModel : ViewModel { #region Fields diff --git a/Masonry.Example/Views/MainView.xaml b/Masonry.Example/Views/MainView.xaml index ca5a89f..caa0e59 100644 --- a/Masonry.Example/Views/MainView.xaml +++ b/Masonry.Example/Views/MainView.xaml @@ -3,8 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:prism="http://prismlibrary.com/" xmlns:masonry="clr-namespace:Masonry;assembly=Masonry" - xmlns:common="clr-namespace:Masonry.Example.Common" - prism:ViewModelLocator.AutoWireViewModel="True"> + xmlns:common="clr-namespace:Masonry.Example.Common"> diff --git a/Masonry.Example/Views/MainView.xaml.cs b/Masonry.Example/Views/MainView.xaml.cs index c4db237..a6ad655 100644 --- a/Masonry.Example/Views/MainView.xaml.cs +++ b/Masonry.Example/Views/MainView.xaml.cs @@ -20,6 +20,8 @@ You should have received a copy of the GNU General Public License #endregion License +using Masonry.Example.ViewModels; + namespace Masonry.Example.Views { /// @@ -27,11 +29,21 @@ namespace Masonry.Example.Views /// public partial class MainView { + private MainViewModel _viewModel; + + private MainViewModel ViewModel + { + get { return _viewModel; } + set { _viewModel = value; DataContext = _viewModel; } + } + #region Constructors and Destructors public MainView() { this.InitializeComponent(); + + ViewModel = new MainViewModel(); } #endregion diff --git a/Masonry.Example/packages.config b/Masonry.Example/packages.config deleted file mode 100644 index 64bcb0f..0000000 --- a/Masonry.Example/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Masonry.sln b/Masonry.sln index 2766f8f..f05fae2 100644 --- a/Masonry.sln +++ b/Masonry.sln @@ -1,31 +1,132 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34902.65 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masonry", "Masonry\Masonry.csproj", "{E2BA75BF-C535-46B9-A180-E10533A1C1D1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masonry", "Masonry\Masonry.csproj", "{E2BA75BF-C535-46B9-A180-E10533A1C1D1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masonry.Example", "Masonry.Example\Masonry.Example.csproj", "{0ACC6BCC-EEC0-4E97-AF52-060FDB7E4DC2}" - ProjectSection(ProjectDependencies) = postProject - {E2BA75BF-C535-46B9-A180-E10533A1C1D1} = {E2BA75BF-C535-46B9-A180-E10533A1C1D1} +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".ci", ".ci", "{BF9C98A2-6215-41C8-971E-6AC7390F3747}" + ProjectSection(SolutionItems) = preProject + azure-pipelines-mergetest.yml = azure-pipelines-mergetest.yml + azure-pipelines-release.yml = azure-pipelines-release.yml + README.md = README.md EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masonry.Example", "Masonry.Example\Masonry.Example.csproj", "{C5AF1425-A0D4-441D-B3F8-E39DF91EA478}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MasonryWinUI", "MasonryWinUI\MasonryWinUI.csproj", "{307D1FD7-7D72-4E79-92E1-60D8B09DB357}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MasonryWinUI.Example", "MasonryWinUI.Example\MasonryWinUI.Example.csproj", "{8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Debug|ARM.ActiveCfg = Debug|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Debug|ARM.Build.0 = Debug|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Debug|ARM64.Build.0 = Debug|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Debug|x64.ActiveCfg = Debug|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Debug|x64.Build.0 = Debug|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Debug|x86.ActiveCfg = Debug|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Debug|x86.Build.0 = Debug|Any CPU {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Release|Any CPU.ActiveCfg = Release|Any CPU {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Release|Any CPU.Build.0 = Release|Any CPU - {0ACC6BCC-EEC0-4E97-AF52-060FDB7E4DC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0ACC6BCC-EEC0-4E97-AF52-060FDB7E4DC2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0ACC6BCC-EEC0-4E97-AF52-060FDB7E4DC2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0ACC6BCC-EEC0-4E97-AF52-060FDB7E4DC2}.Release|Any CPU.Build.0 = Release|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Release|ARM.ActiveCfg = Release|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Release|ARM.Build.0 = Release|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Release|ARM64.ActiveCfg = Release|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Release|ARM64.Build.0 = Release|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Release|x64.ActiveCfg = Release|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Release|x64.Build.0 = Release|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Release|x86.ActiveCfg = Release|Any CPU + {E2BA75BF-C535-46B9-A180-E10533A1C1D1}.Release|x86.Build.0 = Release|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Debug|ARM.ActiveCfg = Debug|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Debug|ARM.Build.0 = Debug|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Debug|ARM64.Build.0 = Debug|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Debug|x64.ActiveCfg = Debug|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Debug|x64.Build.0 = Debug|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Debug|x86.ActiveCfg = Debug|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Debug|x86.Build.0 = Debug|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Release|Any CPU.Build.0 = Release|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Release|ARM.ActiveCfg = Release|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Release|ARM.Build.0 = Release|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Release|ARM64.ActiveCfg = Release|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Release|ARM64.Build.0 = Release|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Release|x64.ActiveCfg = Release|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Release|x64.Build.0 = Release|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Release|x86.ActiveCfg = Release|Any CPU + {C5AF1425-A0D4-441D-B3F8-E39DF91EA478}.Release|x86.Build.0 = Release|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Debug|Any CPU.Build.0 = Debug|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Debug|ARM.ActiveCfg = Debug|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Debug|ARM.Build.0 = Debug|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Debug|ARM64.Build.0 = Debug|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Debug|x64.ActiveCfg = Debug|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Debug|x64.Build.0 = Debug|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Debug|x86.ActiveCfg = Debug|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Debug|x86.Build.0 = Debug|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Release|Any CPU.ActiveCfg = Release|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Release|Any CPU.Build.0 = Release|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Release|ARM.ActiveCfg = Release|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Release|ARM.Build.0 = Release|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Release|ARM64.ActiveCfg = Release|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Release|ARM64.Build.0 = Release|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Release|x64.ActiveCfg = Release|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Release|x64.Build.0 = Release|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Release|x86.ActiveCfg = Release|Any CPU + {307D1FD7-7D72-4E79-92E1-60D8B09DB357}.Release|x86.Build.0 = Release|Any CPU + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|Any CPU.ActiveCfg = Debug|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|Any CPU.Build.0 = Debug|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|Any CPU.Deploy.0 = Debug|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|ARM.ActiveCfg = Debug|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|ARM.Build.0 = Debug|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|ARM.Deploy.0 = Debug|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|ARM64.Build.0 = Debug|ARM64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|x64.ActiveCfg = Debug|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|x64.Build.0 = Debug|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|x64.Deploy.0 = Debug|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|x86.ActiveCfg = Debug|x86 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|x86.Build.0 = Debug|x86 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Debug|x86.Deploy.0 = Debug|x86 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|Any CPU.ActiveCfg = Release|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|Any CPU.Build.0 = Release|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|Any CPU.Deploy.0 = Release|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|ARM.ActiveCfg = Release|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|ARM.Build.0 = Release|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|ARM.Deploy.0 = Release|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|ARM64.ActiveCfg = Release|ARM64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|ARM64.Build.0 = Release|ARM64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|ARM64.Deploy.0 = Release|ARM64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|x64.ActiveCfg = Release|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|x64.Build.0 = Release|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|x64.Deploy.0 = Release|x64 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|x86.ActiveCfg = Release|x86 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|x86.Build.0 = Release|x86 + {8AE04D02-7F9F-48AB-A117-2D6BEFDCD78A}.Release|x86.Deploy.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FAB7FADE-1142-4A72-8A8B-ABA1BA05AEAC} + EndGlobalSection EndGlobal diff --git a/Masonry/Masonry.csproj b/Masonry/Masonry.csproj index a126924..eb8035a 100644 --- a/Masonry/Masonry.csproj +++ b/Masonry/Masonry.csproj @@ -1,70 +1,30 @@ - - - - - Debug - AnyCPU - {E2BA75BF-C535-46B9-A180-E10533A1C1D1} - Library - Properties - Masonry - Masonry - v4.5.2 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - Masonry.ruleset - true - bin\Debug\Masonry.xml - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - Masonry.ruleset - - - false - - - - - - - - - - - - - - - - - - - - - - default.licenseheader - - - - + + + net461;net8-windows;net9-windows;net8.0-windows10.0.18362;net9.0-windows10.0.18362; + true + true + true + true + wpfmasonry + WPF Masonry + Masonry + $(AssemblyName) ($(TargetFramework)) + Lizzaran newky2k + MIT + 2.1 + Fluid layout grid for WPF (.NET 8+ and .Net Framework) + https://github.com/newky2k/WPF-Masonry + https://github.com/newky2k/WPF-Masonry + Git + WPF Masonry Fluid + + Updated to work with .NET 9.0 + + Copyright 2013 - 2016 Nikita Bernthaler + readme.md + + + + + \ No newline at end of file diff --git a/Masonry/Properties/AssemblyInfo.cs b/Masonry/Properties/AssemblyInfo.cs index 4e4b4c7..62ff407 100644 --- a/Masonry/Properties/AssemblyInfo.cs +++ b/Masonry/Properties/AssemblyInfo.cs @@ -27,15 +27,6 @@ You should have received a copy of the GNU General Public License // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Masonry")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Masonry")] -[assembly: AssemblyCopyright("Copyright © 2016 by Nikita Bernthaler")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. @@ -57,5 +48,3 @@ You should have received a copy of the GNU General Public License // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/MasonryWinUI.Example/App.xaml b/MasonryWinUI.Example/App.xaml new file mode 100644 index 0000000..e81b23d --- /dev/null +++ b/MasonryWinUI.Example/App.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/MasonryWinUI.Example/App.xaml.cs b/MasonryWinUI.Example/App.xaml.cs new file mode 100644 index 0000000..29144af --- /dev/null +++ b/MasonryWinUI.Example/App.xaml.cs @@ -0,0 +1,50 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using Microsoft.UI.Xaml.Shapes; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace MasonryWinUI.Example +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + public partial class App : Application + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + /// + /// Invoked when the application is launched. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + m_window = new MainWindow(); + m_window.Activate(); + } + + private Window m_window; + } +} diff --git a/MasonryWinUI.Example/Assets/LockScreenLogo.scale-200.png b/MasonryWinUI.Example/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000..7440f0d Binary files /dev/null and b/MasonryWinUI.Example/Assets/LockScreenLogo.scale-200.png differ diff --git a/MasonryWinUI.Example/Assets/SplashScreen.scale-200.png b/MasonryWinUI.Example/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000..32f486a Binary files /dev/null and b/MasonryWinUI.Example/Assets/SplashScreen.scale-200.png differ diff --git a/MasonryWinUI.Example/Assets/Square150x150Logo.scale-200.png b/MasonryWinUI.Example/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000..53ee377 Binary files /dev/null and b/MasonryWinUI.Example/Assets/Square150x150Logo.scale-200.png differ diff --git a/MasonryWinUI.Example/Assets/Square44x44Logo.scale-200.png b/MasonryWinUI.Example/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000..f713bba Binary files /dev/null and b/MasonryWinUI.Example/Assets/Square44x44Logo.scale-200.png differ diff --git a/MasonryWinUI.Example/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/MasonryWinUI.Example/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000..dc9f5be Binary files /dev/null and b/MasonryWinUI.Example/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/MasonryWinUI.Example/Assets/StoreLogo.png b/MasonryWinUI.Example/Assets/StoreLogo.png new file mode 100644 index 0000000..a4586f2 Binary files /dev/null and b/MasonryWinUI.Example/Assets/StoreLogo.png differ diff --git a/MasonryWinUI.Example/Assets/Wide310x150Logo.scale-200.png b/MasonryWinUI.Example/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000..8b4a5d0 Binary files /dev/null and b/MasonryWinUI.Example/Assets/Wide310x150Logo.scale-200.png differ diff --git a/MasonryWinUI.Example/Assets/jobs_white.png b/MasonryWinUI.Example/Assets/jobs_white.png new file mode 100644 index 0000000..4a2c30d Binary files /dev/null and b/MasonryWinUI.Example/Assets/jobs_white.png differ diff --git a/MasonryWinUI.Example/MainPage.xaml b/MasonryWinUI.Example/MainPage.xaml new file mode 100644 index 0000000..de8e730 --- /dev/null +++ b/MasonryWinUI.Example/MainPage.xaml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MasonryWinUI.Example/MainPage.xaml.cs b/MasonryWinUI.Example/MainPage.xaml.cs new file mode 100644 index 0000000..b47e44f --- /dev/null +++ b/MasonryWinUI.Example/MainPage.xaml.cs @@ -0,0 +1,35 @@ + +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using System.Windows.Media; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace MasonryWinUI.Example +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class MainPage : Page + { + public System.Windows.Media.Brush WhiteBrush = new System.Windows.Media.SolidColorBrush(Colors.White); + + public MainPage() + { + this.InitializeComponent(); + } + } +} diff --git a/MasonryWinUI.Example/MainWindow.xaml b/MasonryWinUI.Example/MainWindow.xaml new file mode 100644 index 0000000..af94d69 --- /dev/null +++ b/MasonryWinUI.Example/MainWindow.xaml @@ -0,0 +1,11 @@ + + + + diff --git a/MasonryWinUI.Example/MainWindow.xaml.cs b/MasonryWinUI.Example/MainWindow.xaml.cs new file mode 100644 index 0000000..2885f3a --- /dev/null +++ b/MasonryWinUI.Example/MainWindow.xaml.cs @@ -0,0 +1,32 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace MasonryWinUI.Example +{ + /// + /// An empty window that can be used on its own or navigated to within a Frame. + /// + public sealed partial class MainWindow : Window + { + public MainWindow() + { + this.InitializeComponent(); + } + + } +} diff --git a/MasonryWinUI.Example/MasonryWinUI.Example.csproj b/MasonryWinUI.Example/MasonryWinUI.Example.csproj new file mode 100644 index 0000000..3f6657a --- /dev/null +++ b/MasonryWinUI.Example/MasonryWinUI.Example.csproj @@ -0,0 +1,63 @@ + + + WinExe + net9.0-windows10.0.19041.0 + 10.0.17763.0 + MasonryWinUI.Example + app.manifest + x86;x64;ARM64 + win-x86;win-x64;win-arm64 + win10-x86;win10-x64;win10-arm64 + win-$(Platform).pubxml + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + + + + + + true + + \ No newline at end of file diff --git a/MasonryWinUI.Example/Package.appxmanifest b/MasonryWinUI.Example/Package.appxmanifest new file mode 100644 index 0000000..c90c1f2 --- /dev/null +++ b/MasonryWinUI.Example/Package.appxmanifest @@ -0,0 +1,51 @@ + + + + + + + + + + MasonryWinUI.Example + Admin + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MasonryWinUI.Example/Properties/launchSettings.json b/MasonryWinUI.Example/Properties/launchSettings.json new file mode 100644 index 0000000..e1686f3 --- /dev/null +++ b/MasonryWinUI.Example/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "MasonryWinUI.Example (Package)": { + "commandName": "MsixPackage" + }, + "MasonryWinUI.Example (Unpackaged)": { + "commandName": "Project" + } + } +} \ No newline at end of file diff --git a/MasonryWinUI.Example/ViewModels/MainViewModel.cs b/MasonryWinUI.Example/ViewModels/MainViewModel.cs new file mode 100644 index 0000000..763162e --- /dev/null +++ b/MasonryWinUI.Example/ViewModels/MainViewModel.cs @@ -0,0 +1,72 @@ +using Microsoft.UI; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Media; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Mvvm; +using System.Text; +using System.Threading.Tasks; +using Windows.UI; +using Windows.UI.Xaml; + +namespace MasonryWinUI.Example +{ + public class MainViewModel : ViewModel + { + public Brush WhiteBrush = new SolidColorBrush(Colors.White); + + private ObservableCollection _elements; + + public ObservableCollection Elements + { + get { return _elements; } + set { _elements = value; NotifyPropertyChanged(nameof(Elements)); } + } + + public MainViewModel() + { + var items = new ObservableCollection(); + + items.Add(new Border() + { + Width = 200, + Height = 400, + Background = new SolidColorBrush(Colors.Green), + }); + + items.Add(new Border() + { + Width = 400, + Height = 200, + Background = new SolidColorBrush(Colors.Red), + }); + + items.Add(new Border() + { + Width = 200, + Height = 200, + Background = new SolidColorBrush(Colors.Gray), + }); + + + items.Add(new Border() + { + Width = 200, + Height = 200, + Background = new SolidColorBrush(Colors.Gray), + }); + + items.Add(new Border() + { + Width = 400, + Height = 400, + Background = new SolidColorBrush(Colors.Orange), + }); + + Elements = items; + } + } +} diff --git a/MasonryWinUI.Example/app.manifest b/MasonryWinUI.Example/app.manifest new file mode 100644 index 0000000..ae4b2a5 --- /dev/null +++ b/MasonryWinUI.Example/app.manifest @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + PerMonitorV2 + + + \ No newline at end of file diff --git a/MasonryWinUI/MasonryControl.winui.cs b/MasonryWinUI/MasonryControl.winui.cs new file mode 100644 index 0000000..1488c83 --- /dev/null +++ b/MasonryWinUI/MasonryControl.winui.cs @@ -0,0 +1,354 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Windows.Foundation; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; + +namespace MasonryWinUI +{ + public class MasonryControl : ItemsControl + { + #region Static Fields + + /// + /// The spacing property + /// + public static readonly DependencyProperty SpacingProperty = DependencyProperty.Register(nameof(Spacing), typeof(int), typeof(MasonryControl), null); + + + #endregion + + #region Public Properties + + /// + /// Gets or sets the spacing. + /// + /// + /// The spacing. + /// + public int Spacing + { + get + { + return (int)this.GetValue(SpacingProperty); + } + set + { + this.SetValue(SpacingProperty, value); + } + } + + #endregion + + #region Public Methods and Operators + + /// + /// Updates this instance. + /// + public virtual void Update() + { + var matrix = new List { new[] { 0, (int)this.ActualWidth, 0 } }; + var hMax = 0; + foreach (var child in this.Items) + { + var element = child as FrameworkElement; + if (element != null) + { + var size = new[] + { (int)element.ActualWidth + this.Spacing, (int)element.ActualHeight + this.Spacing }; + var point = this.GetAttachPoint(matrix, size[0]); + matrix = this.UpdateAttachArea(matrix, point, size); + hMax = Math.Max(hMax, point[1] + size[1]); + this.UpdateAlignment(element); + var oldThickness = element.Margin; + if (Math.Abs(oldThickness.Left - point[0]) > 1 || Math.Abs(oldThickness.Top - point[1]) > 1) + { + this.SetPosition(element, point[1], point[0]); + } + } + } + } + + #endregion + + public MasonryControl() + { + this.DefaultStyleKey = typeof(MasonryControl); + + + } + + #region Methods + + /// + /// Adds the specified object as the child of the object. + /// + /// The object to add as a child. + /// Child has to derive from FrameworkElement. + protected void AddChild(object value) + { + if (!(value is FrameworkElement)) + { + throw new InvalidDataException("Child has to derive from FrameworkElement."); + } + + this.Items.Add(value); + } + + /// + /// Handles the child desired size changed. + /// + /// The child. + protected virtual void HandleChildDesiredSizeChanged(UIElement child) + { + this.HandleUpdate(child as FrameworkElement); + } + + + + /// + /// Handles the update. + /// + /// The element. + protected void HandleUpdate(FrameworkElement element) + { + if (element != null) + { + if (element.IsLoaded) + { + this.Update(); + } + else + { + element.Loaded += delegate { this.Update(); }; + } + } + } + + + protected override void OnItemsChanged(object e) + { + base.OnItemsChanged(e); + + if (Items != null) + { + foreach (var child in Items) + { + this.HandleUpdate(child as FrameworkElement); + } + } + } + + + + + protected override Size ArrangeOverride(Size finalSize) + { + this.Update(); + + return base.ArrangeOverride(finalSize); + } + + protected override void OnBringIntoViewRequested(BringIntoViewRequestedEventArgs e) + { + this.Update(); + + base.OnBringIntoViewRequested(e); + } + + protected override void PrepareContainerForItemOverride(DependencyObject element, object item) + { + this.Update(); + + base.PrepareContainerForItemOverride(element, item); + } + + protected override Size MeasureOverride(Size availableSize) + { + this.Update(); + + return base.MeasureOverride(availableSize); + } + + + ///// + ///// Raises the event, using the specified information as + ///// part of the eventual event data. + ///// + ///// Details of the old and new size involved in the change. + //protected override void OnRenderSizeChanged(Size sizeInfo) + //{ + // base.OnRenderSizeChanged(sizeInfo); + // this.HandleRenderSizeChanged(sizeInfo); + //} + + ///// + ///// Supports layout behavior when a child element is resized. + ///// + ///// The child element that is being resized. + //protected override void OnChildDesiredSizeChanged(UIElement child) + //{ + // base.OnChildDesiredSizeChanged(child); + // this.HandleChildDesiredSizeChanged(child); + //} + + /// + /// Sets the position. + /// + /// The element. + /// The new top. + /// The new left. + protected virtual void SetPosition(FrameworkElement element, int newTop, int newLeft) + { + if (element != null) + { + element.Margin = new Thickness(newLeft, newTop, 0, 0); + } + } + + /// + /// Updates the alignment. + /// + /// The element. + protected virtual void UpdateAlignment(FrameworkElement element) + { + if (element != null) + { + element.HorizontalAlignment = HorizontalAlignment.Left; + element.VerticalAlignment = VerticalAlignment.Top; + } + } + + /// + /// Gets the attach point. + /// + /// The MTX. + /// The width. + /// + private int[] GetAttachPoint(List mtx, int width) + { + mtx.Sort(this.MatrixSortDepth); + var max = mtx[mtx.Count - 1][2]; + for (int i = 0, length = mtx.Count; i < length; i++) + { + if (mtx[i][2] >= max) + { + break; + } + if (mtx[i][1] - mtx[i][0] >= width) + { + return new[] { mtx[i][0], mtx[i][2] }; + } + } + return new[] { 0, max }; + } + + /// + /// Matrixes the join. + /// + /// The MTX. + /// The cell. + /// + private List MatrixJoin(List mtx, int[] cell) + { + mtx.Add(cell); + mtx.Sort(this.MatrixSortX); + var mtxJoin = new List(); + for (int i = 0, length = mtx.Count; i < length; i++) + { + if (mtxJoin.Count > 0 && mtxJoin[mtxJoin.Count - 1][1] == mtx[i][0] + && mtxJoin[mtxJoin.Count - 1][2] == mtx[i][2]) + { + mtxJoin[mtxJoin.Count - 1][1] = mtx[i][1]; + } + else + { + mtxJoin.Add(mtx[i]); + } + } + return mtxJoin; + } + + /// + /// Matrixes the sort depth. + /// + /// a. + /// The b. + /// + private int MatrixSortDepth(int[] a, int[] b) + { + return (a[2] == b[2] && a[0] > b[0]) || a[2] > b[2] ? 1 : -1; + } + + /// + /// Matrixes the sort x. + /// + /// a. + /// The b. + /// + private int MatrixSortX(int[] a, int[] b) + { + return a[0] > b[0] ? 1 : -1; + } + + /// + /// Matrixes the width of the trim. + /// + /// a. + /// The b. + /// + private int[] MatrixTrimWidth(int[] a, int[] b) + { + if (a[0] >= b[0] && a[0] < b[1] || a[1] >= b[0] && a[1] < b[1]) + { + if (a[0] >= b[0] && a[0] < b[1]) + { + a[0] = b[1]; + } + else + { + a[1] = b[0]; + } + } + return a; + } + + /// + /// Updates the attach area. + /// + /// The MTX. + /// The point. + /// The size. + /// + private List UpdateAttachArea(List mtx, int[] point, int[] size) + { + mtx.Sort(this.MatrixSortDepth); + int[] cell = { point[0], point[0] + size[0], point[1] + size[1] }; + for (int i = 0, length = mtx.Count; i < length; i++) + { + if (mtx.Count - 1 >= i) + { + if (cell[0] <= mtx[i][0] && mtx[i][1] <= cell[1]) + { + mtx.RemoveAt(i); + } + else + { + mtx[i] = this.MatrixTrimWidth(mtx[i], cell); + } + } + } + return this.MatrixJoin(mtx, cell); + } + + #endregion + + protected override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + Update(); + } + } +} diff --git a/MasonryWinUI/MasonryWinUI.csproj b/MasonryWinUI/MasonryWinUI.csproj new file mode 100644 index 0000000..5804f98 --- /dev/null +++ b/MasonryWinUI/MasonryWinUI.csproj @@ -0,0 +1,42 @@ + + + net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0; + 10.0.17763.0 + MasonryWinUI + win-x86;win-x64;win-arm64 + win10-x86;win10-x64;win10-arm64 + true + true + true + true + LoDaTek.MasonryWinUI + Masonry for WinUI + MasonryWinUI + $(AssemblyName) ($(TargetFramework)) + newky2k + MIT + 2.1 + Fluid layout grid for WinUI + https://github.com/newky2k/WPF-Masonry + https://github.com/newky2k/WPF-Masonry + Git + WinUI Masonry Fluid + + Updated to work with .NET 8.0 + + Copyright 2024 LoDaTek Ltd + readme.md + true + true + + + + + + + + + + + + diff --git a/MasonryWinUI/Themes/Generic.xaml b/MasonryWinUI/Themes/Generic.xaml new file mode 100644 index 0000000..388468c --- /dev/null +++ b/MasonryWinUI/Themes/Generic.xaml @@ -0,0 +1,67 @@ + + + + + + + diff --git a/MasonryWinUI/Tile.winui.cs b/MasonryWinUI/Tile.winui.cs new file mode 100644 index 0000000..0de6403 --- /dev/null +++ b/MasonryWinUI/Tile.winui.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; + +namespace MasonryWinUI +{ + public sealed class Tile : Button + { + public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(nameof(Title), typeof(string), typeof(Tile), new PropertyMetadata(default(string))); + + public string Title + { + get { return (string)GetValue(TitleProperty); } + set { SetValue(TitleProperty, value); } + } + + /// + /// HorizontalTitleAlignment Dependency Property. + /// Default Value: HorizontalAlignment.Left + /// + public static readonly DependencyProperty HorizontalTitleAlignmentProperty = + DependencyProperty.Register( + nameof(HorizontalTitleAlignment), + typeof(HorizontalAlignment), + typeof(Tile), + new PropertyMetadata(HorizontalAlignment.Left)); + + /// + /// Gets/Sets the horizontal alignment of the title. + /// + [System.ComponentModel.Bindable(true), Category("Layout")] + public HorizontalAlignment HorizontalTitleAlignment + { + get { return (HorizontalAlignment)GetValue(HorizontalTitleAlignmentProperty); } + set { SetValue(HorizontalTitleAlignmentProperty, value); } + } + + /// + /// VerticalTitleAlignment Dependency Property. + /// Default Value: VerticalAlignment.Bottom + /// + public static readonly DependencyProperty VerticalTitleAlignmentProperty = + DependencyProperty.Register( + nameof(VerticalTitleAlignment), + typeof(VerticalAlignment), + typeof(Tile), + new PropertyMetadata(VerticalAlignment.Bottom)); + + /// + /// Gets/Sets the vertical alignment of the title. + /// + [System.ComponentModel.Bindable(true), Category("Layout")] + public VerticalAlignment VerticalTitleAlignment + { + get { return (VerticalAlignment)GetValue(VerticalTitleAlignmentProperty); } + set { SetValue(VerticalTitleAlignmentProperty, value); } + } + + public static readonly DependencyProperty CountProperty = DependencyProperty.Register(nameof(Count), typeof(string), typeof(Tile), new PropertyMetadata(default(string))); + + public string Count + { + get { return (string)GetValue(CountProperty); } + set { SetValue(CountProperty, value); } + } + + public static readonly DependencyProperty TiltFactorProperty = DependencyProperty.Register(nameof(TiltFactor), typeof(int), typeof(Tile), new PropertyMetadata(5)); + + public int TiltFactor + { + get { return (Int32)GetValue(TiltFactorProperty); } + set { SetValue(TiltFactorProperty, value); } + } + + public static readonly DependencyProperty TitleFontSizeProperty = DependencyProperty.Register(nameof(TitleFontSize), typeof(double), typeof(Tile), new PropertyMetadata(12d)); + + public double TitleFontSize + { + get { return (double)GetValue(TitleFontSizeProperty); } + set { SetValue(TitleFontSizeProperty, value); } + } + + public static readonly DependencyProperty CountFontSizeProperty = DependencyProperty.Register(nameof(CountFontSize), typeof(double), typeof(Tile), new PropertyMetadata(28d)); + + public double CountFontSize + { + get { return (double)GetValue(CountFontSizeProperty); } + set { SetValue(CountFontSizeProperty, value); } + } + public Tile() + { + this.DefaultStyleKey = typeof(Tile); + } + } +} diff --git a/azure-pipelines-mergetest.yml b/azure-pipelines-mergetest.yml new file mode 100644 index 0000000..f61a9b8 --- /dev/null +++ b/azure-pipelines-mergetest.yml @@ -0,0 +1,36 @@ +# .NET Desktop +# Build and run tests for .NET Desktop or Windows classic desktop solutions. +# Add steps that publish symbols, save build artifacts, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net + +trigger: none + +pool: + vmImage: 'windows-latest' + +variables: + solution: '**/*.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + netVersion: '9.x' + +steps: +- task: NuGetToolInstaller@1 + displayName: Install Latest Nuget + +- task: UseDotNet@2 + displayName: 'Install .NET sdk' + inputs: + packageType: 'sdk' + version: $(netVersion) + +- task: DotNetCoreCLI@2 + inputs: + command: 'restore' + projects: '*.sln' + +- task: DotNetCoreCLI@2 + displayName: dotnet build + inputs: + projects: '$(solution)' + arguments: '--configuration=$(buildConfiguration) /p:Platform="$(buildPlatform)"' \ No newline at end of file diff --git a/azure-pipelines-release.yml b/azure-pipelines-release.yml new file mode 100644 index 0000000..416b43a --- /dev/null +++ b/azure-pipelines-release.yml @@ -0,0 +1,60 @@ +# .NET Desktop +# Build and run tests for .NET Desktop or Windows classic desktop solutions. +# Add steps that publish symbols, save build artifacts, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net + +trigger: + batch: true + branches: + include: + - master + paths: + exclude: + - '*.yml' + +pool: + vmImage: 'windows-latest' + +variables: + solution: '**/*.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + netVersion: '9.x' + releaseSuffix: '' + +name: 3.0.$(date:yyMM).$(date:dd)$(rev:r) +steps: +- task: NuGetToolInstaller@1 + displayName: Install Latest Nuget + +- task: UseDotNet@2 + displayName: 'Install .NET sdk' + inputs: + packageType: 'sdk' + version: $(netVersion) + +- task: DotNetCoreCLI@2 + inputs: + command: 'restore' + projects: '$(solution)' + +- task: DotNetCoreCLI@2 + displayName: dotnet build + inputs: + projects: '$(solution)' + arguments: '--configuration=$(buildConfiguration) /p:Platform="$(buildPlatform)" /p:Version=$(Build.BuildNumber) /p:AssemblyVersion=$(Build.BuildNumber) /p:FileVersion=$(Build.BuildNumber) ' + +- task: CopyFiles@2 + displayName: Copy Files to $(build.artifactstagingdirectory) + inputs: + SourceFolder: '$(system.defaultworkingdirectory)' + Contents: '**/*.nupkg' + TargetFolder: '$(build.artifactstagingdirectory)' + flattenFolders: true + +- task: PublishBuildArtifacts@1 + displayName: Publish Artifacts drop + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'drop' + publishLocation: 'Container' diff --git a/global.json b/global.json new file mode 100644 index 0000000..a0ee6a6 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "5.0" + } +} \ No newline at end of file