Example #1
0
        public void SkillAllTaggedNodes()
        {
            if (!GetCheckedNodes().Except(SkilledNodes).Any())
            {
                Popup.Info(L10n.Message("Please tag non-skilled nodes by right-clicking them."));
                return;
            }

            try
            {
                // Use the SettingsViewModel without View and with a fixed SteinerTabViewModel.
                var settingsVm = new SettingsViewModel(this, new SteinerTabViewModel(this));
                settingsVm.StartController += (sender, args) =>
                {
                    var dialog = new ControllerWindow() {Owner = MainWindow, DataContext = args.ViewModel};
                    dialog.ShowDialog();
                };
                settingsVm.RunCommand.Execute(null);
            }
            catch (Exception e)
            {
                Popup.Error(L10n.Message("Error while trying to find solution"), e.Message);
                Debug.WriteLine("Exception in 'Skill Tagged Nodes':");
                Debug.WriteLine(e.Message);
            }
        }