private void OnAdd() { var dialog = new PassCardTemplatePropertiesViewModel(null); if (DialogService.ShowModalWindow(dialog)) using (new WaitWrapper()) { var passCardTemplateViewModel = new PassCardTemplateViewModel(dialog.PassCardTemplate); PassCardTemplates.Add(passCardTemplateViewModel); SelectedPassCardTemplate = passCardTemplateViewModel; // ADD TO DATABASE/MARK AS UNSAVED DesignerCanvas.DesignerChanged(); } }
public override void OnShow() { using (new WaitWrapper()) using (new TimeCounter("PassCardsDesignerViewModel.OnShow: {0}")) { base.OnShow(); DesignerCanvas.DeselectAll(); if (DesignerCanvas.Toolbox != null) DesignerCanvas.Toolbox.AcceptKeyboard = true; } if (SelectedPassCardTemplate == null) SelectedPassCardTemplate = PassCardTemplates.FirstOrDefault(); }