Esempio n. 1
0
        public PropertyDetails(AvaloniaObject o, AvaloniaProperty property)
        {
            Name = property.IsAttached ?
                   $"[{property.OwnerType.Name}.{property.Name}]" :
                   property.Name;
            IsAttached = property.IsAttached;

            // TODO: Unsubscribe when view model is deactivated.
            o.GetObservable(property).Subscribe(x =>
            {
                var diagnostic = o.GetDiagnostic(property);
                Value          = diagnostic.Value ?? "(null)";
                Priority       = (diagnostic.Priority != BindingPriority.Unset) ?
                                 diagnostic.Priority.ToString() :
                                 diagnostic.Property.Inherits ? "Inherited" : "Unset";
                Diagnostic = diagnostic.Diagnostic;
            });
        }
Esempio n. 2
0
        public PropertyDetails(AvaloniaObject o, AvaloniaProperty property)
        {
            Name = property.IsAttached ?
                $"[{property.OwnerType.Name}.{property.Name}]" :
                property.Name;
            IsAttached = property.IsAttached;

            // TODO: Unsubscribe when view model is deactivated.
            o.GetObservable(property).Subscribe(x =>
            {
                var diagnostic = o.GetDiagnostic(property);
                Value = diagnostic.Value ?? "(null)";
                Priority = (diagnostic.Priority != BindingPriority.Unset) ?
                    diagnostic.Priority.ToString() :
                    diagnostic.Property.Inherits ? "Inherited" : "Unset";
                Diagnostic = diagnostic.Diagnostic;
            });
        }
        public PropertyDetails(AvaloniaObject o, AvaloniaProperty property)
        {
            _target   = o;
            _property = property;

            Name = property.IsAttached ?
                   $"[{property.OwnerType.Name}.{property.Name}]" :
                   property.Name;
            UpdateGroup();

            // TODO: Unsubscribe when view model is deactivated.
            o.GetObservable(property).Subscribe(x =>
            {
                var diagnostic = o.GetDiagnostic(property);
                RaiseAndSetIfChanged(ref _value, diagnostic.Value);
                Priority = (diagnostic.Priority != BindingPriority.Unset) ?
                           diagnostic.Priority.ToString() :
                           diagnostic.Property.Inherits ? "Inherited" : "Unset";
                Diagnostic = diagnostic.Diagnostic;
            });
        }