Exemplo n.º 1
0
        // https://stackoverflow.com/questions/22790181/wpf-datagrid-row-double-click-event-programmatically
        void dgPatterns_RowDoubleClick(object sender, MouseButtonEventArgs e)
        {
            dgPatterns.CancelEdit();
            // https://stackoverflow.com/questions/16236905/access-parent-window-from-user-control
            var dlg = new PatternsDetailDlg(Window.GetWindow(this), vm, (MPattern)((DataGridRow)sender).Item);

            dlg.ShowDialog();
        }
Exemplo n.º 2
0
        void btnAddPattern_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new PatternsDetailDlg(Window.GetWindow(this), vm, vm.NewPattern());

            dlg.ShowDialog();
        }