private void AddDetailButton_Click(object sender, RoutedEventArgs e)
        {
            var  dialog = new AddDetailWindow(vm);
            bool result = dialog.ShowDialog().GetValueOrDefault(false);

            if (result)
            {
                vm.AddDetail(dialog.DetailResult);
            }
        }
Example #2
0
        private void AddDetailButton_Click(object sender, RoutedEventArgs e)
        {
            var order = (OrderViewModel)orderDataGrid.SelectedItem;

            if (order != null)
            {
                var  dialog = new AddDetailWindow(order);
                bool result = dialog.ShowDialog().GetValueOrDefault(false);
                if (result)
                {
                    order.AddDetail(dialog.DetailResult);
                }
            }
        }