Ejemplo n.º 1
0
        private void AddProductButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            ProductEditor dialog = new ProductEditor();

            dialog.Closed += new EventHandler(ProductEditorDialog_AddClosed);

            dialog.DataContext = null;

            // show the dialog
            dialog.SetForAdd();
            dialog.ShowDialog();
        }
Ejemplo n.º 2
0
        private void UpdateProductButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            ProductEditor dialog = new ProductEditor();

            dialog.Closed += new EventHandler(ProductEditorDialog_UpdateClosed);

            // wire up the context of the dialog to be the same as this editor
            dialog.DataContext = this.DataContext;

            // show the dialog
            dialog.SetForUpdate();
            dialog.ShowDialog();
        }