private void OnAllResourceProvidersButtonClick(object sender, RoutedEventArgs e)
        {
            var elements = new List<object>();

            var propertyViewModel = (BasePropertyViewModel)this.DataContext;
            var element = propertyViewModel.ElementViewModel;

            while (element != null)
            {
                var resources = (element.Model as FrameworkElement)?.Resources;

                if (resources != null)
                {
                    if (resources.Any() ||
                        resources.ThemeDictionaries.Any() ||
                        resources.MergedDictionaries.Any())
                    {
                        elements.Add(element);
                    }
                }

                element = element.Parent as DependencyObjectViewModel;
            }

            if (Application.Current.Resources.Any() ||
                Application.Current.Resources.ThemeDictionaries.Any() ||
                Application.Current.Resources.MergedDictionaries.Any())
            {
                elements.Add(VisualTreeViewModel.Instance.AppViewModel);
            }

            var vm = new ElementListToolWindowViewModel(elements, "Elements with resources");
            DebugConsoleViewModel.Instance.ToolWindows.Add(vm);
        }
        public async void FindSimilar()
        {
            var elements = new List<object>();
            var baseValue = this.Value;

            foreach (var root in DebugConsoleViewModel.Instance.VisualTreeView.RootElements)
            {
                await this.AddSimilarElementsAsync(elements, baseValue, root);
            }

            var vm = new ElementListToolWindowViewModel(elements, this.Name + " == " + this.ValueString);
            DebugConsoleViewModel.Instance.ToolWindows.Add(vm);
        }
Ejemplo n.º 3
0
        public async void FindSimilar()
        {
            var elements  = new List <object>();
            var baseValue = this.Value;

            foreach (var root in DebugConsoleViewModel.Instance.VisualTreeView.RootElements)
            {
                await this.AddSimilarElementsAsync(elements, baseValue, root);
            }

            var vm = new ElementListToolWindowViewModel(elements, this.Name + " == " + this.ValueString);

            DebugConsoleViewModel.Instance.ToolWindows.Add(vm);
        }