public void DialogActivating(object parameters, DialogCommandCollection commands) { IsActive = true; if (commands.Count > 0) { return; } commands.Add("Show Info", new ActionCommand(ShowInfo), false); commands.Add("Show View 2", new ActionCommand(ShowView2), false); }
public CustomDialog() { DefaultStyleKey = typeof(CustomDialog); commandDispatcher = new DialogCommandDispatcher(this); Commands = new DialogCommandCollection(commandDispatcher); Loaded += OnControlLoaded; Unloaded += OnControlUnloaded; // Commands.CollectionChanged += OnCommandsCollectionChanged; }
public void DialogActivating(object parameters, DialogCommandCollection commands) { commands.Add("Import", new RelayCommand(DoImport, CanImport), false); ReEvaluateCommands(); }