-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathObservableObjectPageViewModel.cs
More file actions
41 lines (35 loc) · 1.04 KB
/
ObservableObjectPageViewModel.cs
File metadata and controls
41 lines (35 loc) · 1.04 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
37
38
39
40
41
// 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 System.Threading.Tasks;
namespace MvvmSample.ViewModels
{
public class ObservableObjectPageViewModel : SamplePageViewModel
{
private string name;
/// <summary>
/// Gets or sets the name to display.
/// </summary>
public string Name
{
get => name;
set => SetProperty(ref name, value);
}
private TaskNotifier myTask;
/// <summary>
/// Gets or sets the name to display.
/// </summary>
public Task MyTask
{
get => myTask;
private set => SetPropertyAndNotifyOnCompletion(ref myTask, value);
}
/// <summary>
/// Simulates an asynchronous method.
/// </summary>
public void ReloadTask()
{
MyTask = Task.Delay(3000);
}
}
}