diff --git a/Sample Applications/Win11ThemeGallery/App.xaml.cs b/Sample Applications/Win11ThemeGallery/App.xaml.cs index b88ec2325..eb19e1532 100644 --- a/Sample Applications/Win11ThemeGallery/App.xaml.cs +++ b/Sample Applications/Win11ThemeGallery/App.xaml.cs @@ -107,6 +107,9 @@ public partial class App : Application services.AddSingleton(); services.AddSingleton(); + + services.AddSingleton(); + services.AddSingleton(); }).Build(); diff --git a/Sample Applications/Win11ThemeGallery/MainWindow.xaml b/Sample Applications/Win11ThemeGallery/MainWindow.xaml index fda3b13cd..0afd84892 100644 --- a/Sample Applications/Win11ThemeGallery/MainWindow.xaml +++ b/Sample Applications/Win11ThemeGallery/MainWindow.xaml @@ -154,26 +154,39 @@ - + - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/Sample Applications/Win11ThemeGallery/ViewModels/AboutPageViewModel.cs b/Sample Applications/Win11ThemeGallery/ViewModels/AboutPageViewModel.cs new file mode 100644 index 000000000..c74819f22 --- /dev/null +++ b/Sample Applications/Win11ThemeGallery/ViewModels/AboutPageViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Win11ThemeGallery.Navigation; +using Win11ThemeGallery.Views; + +namespace Win11ThemeGallery.ViewModels +{ + public partial class AboutPageViewModel : ObservableObject + { + [ObservableProperty] + private string _pageTitle = "About"; + } +} diff --git a/Sample Applications/Win11ThemeGallery/ViewModels/MainWindowViewModel.cs b/Sample Applications/Win11ThemeGallery/ViewModels/MainWindowViewModel.cs index e105f9b44..974a7a127 100644 --- a/Sample Applications/Win11ThemeGallery/ViewModels/MainWindowViewModel.cs +++ b/Sample Applications/Win11ThemeGallery/ViewModels/MainWindowViewModel.cs @@ -159,6 +159,12 @@ public void Settings() _navigationService.NavigateTo(typeof(SettingsPage)); } + [RelayCommand] + public void About() + { + _navigationService.NavigateTo(typeof(AboutPage)); + } + [RelayCommand] public void Back() { diff --git a/Sample Applications/Win11ThemeGallery/Views/AboutPage.xaml b/Sample Applications/Win11ThemeGallery/Views/AboutPage.xaml new file mode 100644 index 000000000..f26d663c2 --- /dev/null +++ b/Sample Applications/Win11ThemeGallery/Views/AboutPage.xaml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + © 2024 Microsoft. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CommunityToolkit.Mvvm + + + Microsoft.Extensions.DependencyInjection + + + Microsoft.Extensions.Hosting + + + + + + + + + Microsoft Services Agreement + + + Microsoft Privacy Statement + + + + + + + + + diff --git a/Sample Applications/Win11ThemeGallery/Views/AboutPage.xaml.cs b/Sample Applications/Win11ThemeGallery/Views/AboutPage.xaml.cs new file mode 100644 index 000000000..4e22afe60 --- /dev/null +++ b/Sample Applications/Win11ThemeGallery/Views/AboutPage.xaml.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Win11ThemeGallery.ViewModels; + +namespace Win11ThemeGallery.Views +{ + /// + /// Interaction logic for AboutPage.xaml + /// + public partial class AboutPage : Page + { + public AboutPageViewModel ViewModel { get; } + + public AboutPage(AboutPageViewModel viewModel) + { + ViewModel = viewModel; + DataContext = this; + InitializeComponent(); + } + + private void Services_Click(object sender, RoutedEventArgs e) + { + Process.Start(new ProcessStartInfo("https://go.microsoft.com/fwlink/?LinkId=822631") { UseShellExecute = true }); + } + + private void Privacy_Click(object sender, RoutedEventArgs e) + { + Process.Start(new ProcessStartInfo("https://go.microsoft.com/fwlink/?LinkId=521839") { UseShellExecute = true }); + } + + private void Open_Issues(object sender, MouseButtonEventArgs e) + { + Process.Start(new ProcessStartInfo("https://github.com/microsoft/WPF-Samples/issues/new") { UseShellExecute = true }); + } + + private void Open_ToolkitInformation(object sender, RoutedEventArgs e) + { + Process.Start(new ProcessStartInfo("https://www.nuget.org/packages/CommunityToolkit.Mvvm/") { UseShellExecute = true }); + } + + private void Open_DIInformation(object sender, RoutedEventArgs e) + { + Process.Start(new ProcessStartInfo("https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection/") { UseShellExecute = true }); + } + + private void Open_HostingInformation(object sender, RoutedEventArgs e) + { + Process.Start(new ProcessStartInfo("https://www.nuget.org/packages/Microsoft.Extensions.Hosting") { UseShellExecute = true }); + } + } +}