mirror of
https://github.com/PacktPublishing/Learn-WinUI-3-Second-Edition.git
synced 2026-06-20 12:23:09 +00:00
Add chapter 10 sample project
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using CommunityToolkit.WinUI.UI.Controls;
|
||||
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
using TemplateStudioSampleApp.ViewModels;
|
||||
|
||||
namespace TemplateStudioSampleApp.Views;
|
||||
|
||||
public sealed partial class ListDetailsPage : Page
|
||||
{
|
||||
public ListDetailsViewModel ViewModel
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public ListDetailsPage()
|
||||
{
|
||||
ViewModel = App.GetService<ListDetailsViewModel>();
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnViewStateChanged(object sender, ListDetailsViewState e)
|
||||
{
|
||||
if (e == ListDetailsViewState.Both)
|
||||
{
|
||||
ViewModel.EnsureItemSelected();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user