44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using CommunityToolkit.WinUI.UI.Animations;
|
|
|
|
using Estara.Contracts.Services;
|
|
using Estara.ViewModels;
|
|
|
|
using Microsoft.UI.Xaml.Controls;
|
|
using Microsoft.UI.Xaml.Navigation;
|
|
|
|
namespace Estara.Views;
|
|
|
|
public sealed partial class ContentGridDetailPage : Page
|
|
{
|
|
public ContentGridDetailViewModel ViewModel
|
|
{
|
|
get;
|
|
}
|
|
|
|
public ContentGridDetailPage()
|
|
{
|
|
ViewModel = App.GetService<ContentGridDetailViewModel>();
|
|
InitializeComponent();
|
|
}
|
|
|
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
|
{
|
|
base.OnNavigatedTo(e);
|
|
this.RegisterElementForConnectedAnimation("animationKeyContentGrid", itemHero);
|
|
}
|
|
|
|
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
|
|
{
|
|
base.OnNavigatingFrom(e);
|
|
if (e.NavigationMode == NavigationMode.Back)
|
|
{
|
|
var navigationService = App.GetService<INavigationService>();
|
|
|
|
if (ViewModel.Item != null)
|
|
{
|
|
navigationService.SetListDataItemForNextConnectedAnimation(ViewModel.Item);
|
|
}
|
|
}
|
|
}
|
|
}
|