in ContosoApp/ViewModels/OrderViewModel.cs [92:120]
private static async Task<Order> GetOrder(Guid orderId) =>
await App.Repository.Orders.GetAsync(orderId);
/// <summary>
/// Gets a value that specifies whether the user can refresh the page.
/// </summary>
public bool CanRefresh => Model != null && !IsModified && IsExistingOrder;
/// <summary>
/// Gets a value that specifies whether the user can revert changes.
/// </summary>
public bool CanRevert => Model != null && IsModified && IsExistingOrder;
/// <summary>
/// Gets or sets the order's ID.
/// </summary>
public Guid Id
{
get => Model.Id;
set
{
if (Model.Id != value)
{
Model.Id = value;
OnPropertyChanged();
IsModified = true;
}
}
}