public PropertyDialog(Contractor contractor) { this.ImageHint = "HHH"; this.InitializeComponent(); this.mResetValidationMap = DataTypeFactory.Current.GetNotifications(typeof(Contractor)); this.ClearTextBox = new CommandBridge() { To = this.OnClearTextBox }; this.DataContext = this.iContractor = contractor; this.BuildTextBoxesMap(); this.SetImagesToolTip(); }
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; } }
private async void OpenPopUp(Contractor contractor) { Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated += this.AcceleratorKeyActivated; this.Overlay.Visibility = Visibility.Visible; var pointer = Window.Current.CoreWindow.PointerCursor; Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 1); await ContractorsContext.Current.Expand(contractor); this.popUp.DataContext = contractor; this.SetPopUpSize(); Window.Current.CoreWindow.SizeChanged += this.CoreWindow_SizeChanged; Window.Current.CoreWindow.PointerCursor = pointer; this.popUp.IsOpen = true; }
private async void btnDelete_Click(object sender, RoutedEventArgs e) { var dialog = new MessageDialog( "Действительно удалить ?"); dialog.Commands.Add(new UICommand("Да") { Id = (int)0 }); dialog.Commands.Add(new UICommand("Нет") { Id = (int)1 }); dialog.DefaultCommandIndex = 0; dialog.CancelCommandIndex = 1; var result = await dialog.ShowAsync(); if ((int)result.Id != 0) { return; } var pointer = Window.Current.CoreWindow.PointerCursor; Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 1); Contractor contractor = (Contractor)this.popUp.DataContext; await ContractorsContext.Current.Delete(contractor); this.popUp.IsOpen = false; Window.Current.CoreWindow.PointerCursor = pointer; }
public double CalculateVAT(Contractor contractor) { throw new System.NotImplementedException(); }
public async Task Delete(Contractor contractor) { await ContractorsRepository.Current.Delete(contractor); this.Items.Remove(contractor); }
public void Collapse(Contractor contractor) { contractor.PhotoRaw = null; contractor.Photo = null; }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); this.DataContext = this.Contractor = (Contractor)e.Parameter; }