Esempio n. 1
0
 private void BtnEditOrderClick(object sender, RoutedEventArgs e)
 {
     OrderView view = new OrderView();
     OrderViewModel order = (OrderViewModel)((Button)sender).DataContext;
     order.Mode = Mode.Edit;
     view.DataContext = order;
     view.ShowDialog();
 }
Esempio n. 2
0
 private void BtnAddOrderClick(object sender, RoutedEventArgs e)
 {
     OrderView view = new OrderView();
     OrderViewModel order = new OrderViewModel(ServiceProvider.Instance.Get<IOrderServiceManager>())
                                {
                                    Customer = (CustomerViewModel)DataContext,
                                    Mode = Mode.Add
                                };
     view.DataContext = order;
     view.ShowDialog();
 }