/// <summary> /// Initializes a new instance of the <see cref="BuiltInRulesRibbonPageViewModel"/> class. /// </summary> /// <param name="panelNavigationService"> /// The <see cref="IPanelNavigationService"/> used to navigate to panels/browsers /// </param> /// <param name="dialogNavigationService"> /// The <see cref="IDialogNavigationService"/> that is used to navigate to generic dialogs /// </param> /// <param name="ruleVerificationService"> /// The <see cref="IRuleVerificationService"/> that is used to verify an <see cref="Iteration"/> and provide access to the available <see cref="BuiltInRule"/>s /// </param> public BuiltInRulesRibbonPageViewModel(IPanelNavigationService panelNavigationService, IDialogNavigationService dialogNavigationService, IRuleVerificationService ruleVerificationService) { this.panelNavigationService = panelNavigationService; this.dialogNavigationService = dialogNavigationService; this.ruleVerificationService = ruleVerificationService; this.OpenBrowser = ReactiveCommand.Create(); this.OpenBrowser.Subscribe(_ => this.ExecuteOpenBrowser()); }
/// <summary> /// Initializes a new instance of the <see cref="BuiltInRulesBrowserViewModel"/> class. /// </summary> /// <param name="ruleVerificationService"> /// The <see cref="IRuleVerificationService"/> that provides access to the available <see cref="BuiltInRule"/>s. /// </param> /// <param name="dialogNavigationService"> /// The <see cref="IDialogNavigationService"/> that is used to navigate to generic dialogs /// </param> public BuiltInRulesBrowserViewModel(IRuleVerificationService ruleVerificationService, IDialogNavigationService dialogNavigationService) { this.Identifier = Guid.NewGuid(); this.ruleVerificationService = ruleVerificationService; this.dialogNavigationService = dialogNavigationService; this.BuiltInRules = new List <BuiltInRuleRowViewModel>(); this.PopulateBuiltInRuleRowViewModel(); var canInspect = this.WhenAnyValue(x => x.SelectedRule).Select(x => x != null); this.InspectCommand = ReactiveCommand.Create(canInspect); this.InspectCommand.Subscribe(_ => this.ExecuteInspectCommand()); }
public BuiltInRulesRibbonPage(IPanelNavigationService panelNavigationService, IDialogNavigationService dialogNavigationService, IRuleVerificationService ruleVerificationService) { this.InitializeComponent(); this.DataContext = new BuiltInRulesRibbonPageViewModel(panelNavigationService, dialogNavigationService, ruleVerificationService); }