From 7d8127991f0c511095cd9164604402cf4c65738a Mon Sep 17 00:00:00 2001 From: Max Katz Date: Mon, 27 Feb 2023 22:39:07 -0500 Subject: [PATCH] Return generators sandbox --- Avalonia.sln | 7 ++ samples/Generators.Sandbox/App.xaml | 7 ++ samples/Generators.Sandbox/App.xaml.cs | 20 ++++++ .../Controls/CustomTextBox.cs | 10 +++ .../Controls/SignUpView.xaml | 45 ++++++++++++ .../Controls/SignUpView.xaml.cs | 54 ++++++++++++++ .../Generators.Sandbox.csproj | 28 ++++++++ samples/Generators.Sandbox/Program.cs | 15 ++++ .../ViewModels/SignUpViewModel.cs | 70 +++++++++++++++++++ .../Generators.Sandbox/Views/SignUpView.xaml | 9 +++ .../Views/SignUpView.xaml.cs | 28 ++++++++ 11 files changed, 293 insertions(+) create mode 100644 samples/Generators.Sandbox/App.xaml create mode 100644 samples/Generators.Sandbox/App.xaml.cs create mode 100644 samples/Generators.Sandbox/Controls/CustomTextBox.cs create mode 100644 samples/Generators.Sandbox/Controls/SignUpView.xaml create mode 100644 samples/Generators.Sandbox/Controls/SignUpView.xaml.cs create mode 100644 samples/Generators.Sandbox/Generators.Sandbox.csproj create mode 100644 samples/Generators.Sandbox/Program.cs create mode 100644 samples/Generators.Sandbox/ViewModels/SignUpViewModel.cs create mode 100644 samples/Generators.Sandbox/Views/SignUpView.xaml create mode 100644 samples/Generators.Sandbox/Views/SignUpView.xaml.cs diff --git a/Avalonia.sln b/Avalonia.sln index 1eb4a8b615..b21df07628 100644 --- a/Avalonia.sln +++ b/Avalonia.sln @@ -250,6 +250,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.Generators.Tests", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.Fonts.Inter", "src\Avalonia.Fonts.Inter\Avalonia.Fonts.Inter.csproj", "{13F1135D-BA1A-435C-9C5B-A368D1D63DE4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generators.Sandbox", "samples\Generators.Sandbox\Generators.Sandbox.csproj", "{A82AD1BC-EBE6-4FC3-A13B-D52A50297533}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -589,6 +591,10 @@ Global {13F1135D-BA1A-435C-9C5B-A368D1D63DE4}.Debug|Any CPU.Build.0 = Debug|Any CPU {13F1135D-BA1A-435C-9C5B-A368D1D63DE4}.Release|Any CPU.ActiveCfg = Release|Any CPU {13F1135D-BA1A-435C-9C5B-A368D1D63DE4}.Release|Any CPU.Build.0 = Release|Any CPU + {A82AD1BC-EBE6-4FC3-A13B-D52A50297533}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A82AD1BC-EBE6-4FC3-A13B-D52A50297533}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A82AD1BC-EBE6-4FC3-A13B-D52A50297533}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A82AD1BC-EBE6-4FC3-A13B-D52A50297533}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -658,6 +664,7 @@ Global {DDA28789-C21A-4654-86CE-D01E81F095C5} = {4ED8B739-6F4E-4CD4-B993-545E6B5CE637} {2D7C812B-7E73-4252-8EFD-BC8A4D5CCB9F} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {F4E36AA8-814E-4704-BC07-291F70F45193} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} + {A82AD1BC-EBE6-4FC3-A13B-D52A50297533} = {9B9E3891-2366-4253-A952-D08BCEB71098} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {87366D66-1391-4D90-8999-95A620AD786A} diff --git a/samples/Generators.Sandbox/App.xaml b/samples/Generators.Sandbox/App.xaml new file mode 100644 index 0000000000..8064eac3f5 --- /dev/null +++ b/samples/Generators.Sandbox/App.xaml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/samples/Generators.Sandbox/App.xaml.cs b/samples/Generators.Sandbox/App.xaml.cs new file mode 100644 index 0000000000..6118b3f177 --- /dev/null +++ b/samples/Generators.Sandbox/App.xaml.cs @@ -0,0 +1,20 @@ +using Avalonia; +using Avalonia.Markup.Xaml; +using Generators.Sandbox.ViewModels; + +namespace Generators.Sandbox; + +public class App : Application +{ + public override void Initialize() => AvaloniaXamlLoader.Load(this); + + public override void OnFrameworkInitializationCompleted() + { + var view = new Views.SignUpView + { + ViewModel = new SignUpViewModel() + }; + view.Show(); + base.OnFrameworkInitializationCompleted(); + } +} \ No newline at end of file diff --git a/samples/Generators.Sandbox/Controls/CustomTextBox.cs b/samples/Generators.Sandbox/Controls/CustomTextBox.cs new file mode 100644 index 0000000000..68ee925986 --- /dev/null +++ b/samples/Generators.Sandbox/Controls/CustomTextBox.cs @@ -0,0 +1,10 @@ +using System; +using Avalonia.Controls; +using Avalonia.Styling; + +namespace Generators.Sandbox.Controls; + +public class CustomTextBox : TextBox, IStyleable +{ + Type IStyleable.StyleKey => typeof(TextBox); +} \ No newline at end of file diff --git a/samples/Generators.Sandbox/Controls/SignUpView.xaml b/samples/Generators.Sandbox/Controls/SignUpView.xaml new file mode 100644 index 0000000000..c126f36f53 --- /dev/null +++ b/samples/Generators.Sandbox/Controls/SignUpView.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + +