void RecieveReturnable_Loaded(object sender, RoutedEventArgs e) { _vm = DataContext as RecieveReturnableViewModel; _vm.Setup(); LocalizeLabels(); }
private void hlDelete_Click(object sender, RoutedEventArgs e) { Hyperlink hl = sender as Hyperlink; Guid product = (Guid)hl.Tag; _vm = DataContext as RecieveReturnableViewModel; MessageBoxResult rs = MessageBox.Show("Are you sure you want to delete returnable entry", "Distributr: Recieve returnables", MessageBoxButton.OKCancel); if (rs == MessageBoxResult.OK) { _vm.DeleteReturns(product); } }
/// <summary> /// Provides a deterministic way to create the RecieveReturnableViewModel property. /// </summary> public static void CreateRecieveReturnableViewModel() { if (_RecieveReturnableViewModel == null) { _RecieveReturnableViewModel = new RecieveReturnableViewModel(); } }
private void hlEdit_Click(object sender, RoutedEventArgs e) { modal = new AddReturnableModal(); modal.Closed += new EventHandler(modal_Closed); modal.Closing += modal_Closing; RecieveReturnableLineItemViewModel vmItem = modal.DataContext as RecieveReturnableLineItemViewModel; vmItem.SetUp(); Hyperlink hl = sender as Hyperlink; Guid product = (Guid)hl.Tag; _vm = DataContext as RecieveReturnableViewModel; vmItem.EditLoad(_vm.ReturnableItems.First(p => p.ProductId == product)); modal.ShowDialog(); }
/// <summary> /// Provides a deterministic way to delete the RecieveReturnableViewModel property. /// </summary> public static void ClearRecieveReturnableViewModel() { _RecieveReturnableViewModel.Cleanup(); _RecieveReturnableViewModel = null; }