/// <summary> /// Initializes a new instance of the <see cref="VisualTreeViewModel"/> class. /// </summary> public LogicalTreeViewModel() { _selectedTreeItemService = ServiceLocator.Resolve<SelectedTreeItemService>(); var treeElementService = ServiceLocator.Resolve<LogicalTreeService>(); Elements = new ListCollectionView(treeElementService.Elements); Elements.CurrentChanged += CurrentElementChanged; treeElementService.ElementsChanged += (s, e) => Elements.Refresh(); }
/// <summary> /// Initializes a new instance of the <see cref="AutomationViewModel"/> class. /// </summary> public AutomationViewModel() { var automationTreeService = ServiceLocator.Resolve<AutomationTreeService>(); _selectedTreeItemService = ServiceLocator.Resolve<SelectedTreeItemService>(); Elements = new ListCollectionView(automationTreeService.Elements); Elements.CurrentChanged += CurrentElementChanged; Elements.MoveCurrentToFirst(); }
public IssuesListViewModel() { _selectedTreeItemService = ServiceLocator.Resolve<SelectedTreeItemService>(); _issuesAnalyzerService = ServiceLocator.Resolve<IssuesAnalyzerService>(); Issues = new ListCollectionView(_issuesAnalyzerService.AnalyzerContext.Issues); Issues.SortDescriptions.Add(new SortDescription("Severity", ListSortDirection.Descending)); Issues.Filter = FilterIssues; _issuesAnalyzerService.AnalyzerContext.IssuesChanged += (s, e) => IssuesChanged(); ConfigureAnalyzersCommand = new Command<object>( o => new AnalyzerConfigurationWindow().Show()); }
/// <summary> /// Initializes a new instance of the <see cref="PropertiesViewModel"/> class. /// </summary> public PropertiesViewModel() { // Property List _selectedTreeItemService = ServiceLocator.Resolve<SelectedTreeItemService>(); _selectedTreeItemService.SelectedTreeItemChanged += OnSelectedTreeItemChanged; var issuesAnalyzerService = ServiceLocator.Resolve<IssuesAnalyzerService>(); issuesAnalyzerService.IssueSelected += OnIssueSelected; _updateTrigger.UpdateAction = () => SelectedTreeItem = _selectedTreeItemService.SelectedTreeItem; }
/// <summary> /// Initializes a new instance of the <see cref="IssuesAnalyzerService"/> class. /// </summary> public IssuesAnalyzerService() { LoadAnalyzers(); _rootElementService = ServiceLocator.Resolve<VisualTreeService>(); _selectedTreeItemService = ServiceLocator.Resolve<SelectedTreeItemService>(); _analyzerTimer = new DispatcherTimer(DispatcherPriority.ContextIdle); _analyzerTimer.Tick += (s, e) => Analyze(); _analyzerTimer.Interval = TimeSpan.FromSeconds(2); _analyzerTimer.Start(); }
public MouseElementService() { _selectedTreeItemService = ServiceLocator.Resolve<SelectedTreeItemService>(); _selectedTreeItemService.SelectedTreeItemChanged += OnSelectedTreeItemChanged; _adornerTimer = new DispatcherTimer(DispatcherPriority.Normal) { Interval = TimeSpan.FromMilliseconds(100) }; _adornerTimer.Tick += OnAdornerTimerTick; _adornerTimer.Start(); _settings.ShowAdornerChanged += (s, e) => UpdateAdorner(DireclyOverElement); _refreshTimer = new DispatcherTimer(DispatcherPriority.Background); _refreshTimer.Interval = TimeSpan.FromSeconds(1); _refreshTimer.Tick += (s, e) => ApplySelectedTreeItem(); }
/// <summary> /// Initializes a new instance of the <see cref="VisualTreeViewModel"/> class. /// </summary> public VisualTreeViewModel() { _selectedTreeItemService = ServiceLocator.Resolve<SelectedTreeItemService>(); _selectedTreeItemService.SelectedTreeItemChanged += OnSelectedTreeItemChanged; MouseElementServiceSettings = ServiceLocator.Resolve<MouseElementService>().Settings; var visualTreeElementService = ServiceLocator.Resolve<VisualTreeService>(); visualTreeElementService.ElementsChanged += (s, e) => Elements.Refresh(); //FocusInfo = ServiceLocator.Resolve<FocusedElementService>().Info; Elements = new ListCollectionView(visualTreeElementService.Elements); Elements.CurrentChanged += CurrentElementChanged; Elements.MoveCurrentToFirst(); }
public MouseElementService() { _selectedTreeItemService = ServiceLocator.Resolve <SelectedTreeItemService>(); _selectedTreeItemService.SelectedTreeItemChanged += OnSelectedTreeItemChanged; _adornerTimer = new DispatcherTimer(DispatcherPriority.Normal) { Interval = TimeSpan.FromMilliseconds(100) }; _adornerTimer.Tick += OnAdornerTimerTick; _adornerTimer.Start(); _settings.ShowAdornerChanged += (s, e) => UpdateAdorner(DireclyOverElement); _refreshTimer = new DispatcherTimer(DispatcherPriority.Background); _refreshTimer.Interval = TimeSpan.FromSeconds(1); _refreshTimer.Tick += (s, e) => ApplySelectedTreeItem(); }
public InspectorViewModel() { _selectedTreeItemService = ServiceLocator.Resolve<SelectedTreeItemService>(); _selectedTreeItemService.SearchStrategyChanged += (s, e) => SelectedTreeIndex = e.Data == SearchStrategy.LogicalTree ? 1 : 0; _applicationThemeService = ServiceLocator.Resolve<ApplicationThemeService>(); Themes = new ListCollectionView(_applicationThemeService.Themes); ApplicationSettings = ServiceLocator.Resolve<ApplicationSettingsService>().ApplicationSettings; var resizeService = ServiceLocator.Resolve<ApplicationResizeService>(); Sizes = new ListCollectionView(resizeService.Sizes); AboutCommand = new Command<object>(o => new AboutWindow().ShowDialog()); DetachCommand = new Command<object>(o => ServiceLocator.Resolve<InspectorWindow>().Close()); UpdateShowUsageHint(); }