-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathMessengerRequestPage.xaml.cs
More file actions
36 lines (30 loc) · 1.1 KB
/
MessengerRequestPage.xaml.cs
File metadata and controls
36 lines (30 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using MvvmSample.Core.ViewModels;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
namespace MvvmSampleUwp.Views;
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MessengerRequestPage : Page
{
public MessengerRequestPage()
{
this.InitializeComponent();
}
public MessengerPageViewModel ViewModel => (MessengerPageViewModel)DataContext;
/// <inheritdoc/>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
ViewModel.SenderViewModel.IsActive = true;
ViewModel.ReceiverViewModel.IsActive = true;
}
/// <inheritdoc/>
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
ViewModel.SenderViewModel.IsActive = false;
ViewModel.ReceiverViewModel.IsActive = false;
}
}