diff --git a/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample.sln b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample.sln new file mode 100644 index 0000000..695ab59 --- /dev/null +++ b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33530.505 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI3.SimpleSample", "WinUI3.SimpleSample\WinUI3.SimpleSample.csproj", "{C2045990-4D66-478B-8601-6F997A19C64F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C2045990-4D66-478B-8601-6F997A19C64F}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {C2045990-4D66-478B-8601-6F997A19C64F}.Debug|ARM64.Build.0 = Debug|ARM64 + {C2045990-4D66-478B-8601-6F997A19C64F}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {C2045990-4D66-478B-8601-6F997A19C64F}.Debug|x64.ActiveCfg = Debug|x64 + {C2045990-4D66-478B-8601-6F997A19C64F}.Debug|x64.Build.0 = Debug|x64 + {C2045990-4D66-478B-8601-6F997A19C64F}.Debug|x64.Deploy.0 = Debug|x64 + {C2045990-4D66-478B-8601-6F997A19C64F}.Debug|x86.ActiveCfg = Debug|x86 + {C2045990-4D66-478B-8601-6F997A19C64F}.Debug|x86.Build.0 = Debug|x86 + {C2045990-4D66-478B-8601-6F997A19C64F}.Debug|x86.Deploy.0 = Debug|x86 + {C2045990-4D66-478B-8601-6F997A19C64F}.Release|ARM64.ActiveCfg = Release|ARM64 + {C2045990-4D66-478B-8601-6F997A19C64F}.Release|ARM64.Build.0 = Release|ARM64 + {C2045990-4D66-478B-8601-6F997A19C64F}.Release|ARM64.Deploy.0 = Release|ARM64 + {C2045990-4D66-478B-8601-6F997A19C64F}.Release|x64.ActiveCfg = Release|x64 + {C2045990-4D66-478B-8601-6F997A19C64F}.Release|x64.Build.0 = Release|x64 + {C2045990-4D66-478B-8601-6F997A19C64F}.Release|x64.Deploy.0 = Release|x64 + {C2045990-4D66-478B-8601-6F997A19C64F}.Release|x86.ActiveCfg = Release|x86 + {C2045990-4D66-478B-8601-6F997A19C64F}.Release|x86.Build.0 = Release|x86 + {C2045990-4D66-478B-8601-6F997A19C64F}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F32B7C40-4F34-4A0E-94DF-14A8C171C0B1} + EndGlobalSection +EndGlobal diff --git a/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/App.xaml b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/App.xaml new file mode 100644 index 0000000..aa8da27 --- /dev/null +++ b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/App.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/App.xaml.cs b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/App.xaml.cs new file mode 100644 index 0000000..d54abef --- /dev/null +++ b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/App.xaml.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +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 WinUI3.SimpleSample +{ + /// + /// 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/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/LockScreenLogo.scale-200.png b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000..7440f0d Binary files /dev/null and b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/LockScreenLogo.scale-200.png differ diff --git a/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/SplashScreen.scale-200.png b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000..32f486a Binary files /dev/null and b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/SplashScreen.scale-200.png differ diff --git a/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/Square150x150Logo.scale-200.png b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000..53ee377 Binary files /dev/null and b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/Square150x150Logo.scale-200.png differ diff --git a/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/Square44x44Logo.scale-200.png b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000..f713bba Binary files /dev/null and b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/Square44x44Logo.scale-200.png differ diff --git a/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000..dc9f5be Binary files /dev/null and b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/StoreLogo.png b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/StoreLogo.png new file mode 100644 index 0000000..a4586f2 Binary files /dev/null and b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/StoreLogo.png differ diff --git a/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/Wide310x150Logo.scale-200.png b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000..8b4a5d0 Binary files /dev/null and b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/Assets/Wide310x150Logo.scale-200.png differ diff --git a/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/MainViewModel.cs b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/MainViewModel.cs new file mode 100644 index 0000000..fa2a968 --- /dev/null +++ b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/MainViewModel.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WinUI3.SimpleSample +{ + public class MainViewModel : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + private string _name; + + public MainViewModel() + { + _name = "Bob Jones"; + } + + public string Name + { + get { return _name; } + set + { + if (_name == value) return; + _name = value; + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Name))); + } + } + } +} diff --git a/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/MainWindow.xaml b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/MainWindow.xaml new file mode 100644 index 0000000..03ef26e --- /dev/null +++ b/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/MainWindow.xaml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +