private async void btnEdit_Click(object sender, RoutedEventArgs e) { Contractor contractor = (Contractor)this.popUp.DataContext; var clone = ContractorsContext.Current.CopyForEdit(contractor); PropertyDialog dialog = ContentDialogFactory.Create(clone, new Grid[] { this.OverlayPoup }); this.escPopUpClosingSuspended = true; if (await dialog.ShowAsync() == ContentDialogResult.Primary) { var pointer = Window.Current.CoreWindow.PointerCursor; Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 1); await ContractorsContext.Current.Update(contractor, clone); Window.Current.CoreWindow.PointerCursor = pointer; } this.escPopUpClosingSuspended = false; this.popUp.UpdateLayout(); this.MovePopupRootToCenter(); this.btnBack.Focus(FocusState.Programmatic); }
private async void AddContractor() { Contractor contractor = ContractorsContext.Current.CreateForEdit(); PropertyDialog dialog = ContentDialogFactory.Create(contractor, new Grid[] { this.Overlay }); if (await dialog.ShowAsync() == ContentDialogResult.Primary) { var pointer = Window.Current.CoreWindow.PointerCursor; Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 1); await ContractorsContext.Current.Add(contractor); ContractorsContext.Current.Collapse(contractor); Window.Current.CoreWindow.PointerCursor = pointer; } }