예제 #1
0
        public DevToolsViewModel()
        {
            this.WhenAnyValue(x => x.Root).Subscribe(x =>
            {
                LogicalTree = new LogicalTreeViewModel(_root);
                VisualTree = new VisualTreeViewModel(_root);
            });

            _focusedControl = KeyboardDevice.Instance
                .WhenAnyValue(x => x.FocusedElement)
                .ToProperty(this, x => x.FocusedControl);

            _pointerOverElement = this.WhenAnyValue(x => x.Root, x => x as TopLevel)
                .Select(x => x?.GetObservable(TopLevel.PointerOverElementProperty) ?? Observable.Empty<IInputElement>())
                .Switch()
                .ToProperty(this, x => x.PointerOverElement);
        }
예제 #2
0
        public DevToolsViewModel()
        {
            this.WhenAnyValue(x => x.Root).Subscribe(x =>
            {
                LogicalTree = new LogicalTreeViewModel(_root);
                VisualTree  = new VisualTreeViewModel(_root);
            });

            _focusedControl = KeyboardDevice.Instance
                              .WhenAnyValue(x => x.FocusedElement)
                              .ToProperty(this, x => x.FocusedControl);

            _pointerOverElement = this.WhenAnyValue(x => x.Root, x => x as TopLevel)
                                  .Select(x => x?.GetObservable(TopLevel.PointerOverElementProperty) ?? Observable.Empty <IInputElement>())
                                  .Switch()
                                  .ToProperty(this, x => x.PointerOverElement);
        }