#pragma warning restore SA1202 // Elements must be ordered by access

        private static void OnTrackChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            d.SetValue(EventsPropertyKey, new ObservableCollection <object>());
            _ = BindingHelper.Bind(d, HasErrorProperty)
                .OneWayTo(d, Validation.HasErrorProperty);
            _ = BindingHelper.Bind(d, ErrorsProperty)
                .OneWayTo(d, Validation.ErrorsProperty);
            Validation.AddErrorHandler(d, (o, args) => GetEvents((DependencyObject)o).Add(args));
        }
Example #2
0
 public ContentAdorner(UIElement adornedElement, object content)
     : base(adornedElement)
 {
     _children         = new VisualCollection(this);
     _contentPresenter = new ContentPresenter();
     _children.Add(_contentPresenter);
     BindingHelper.Bind(_contentPresenter, MarginProperty, this, MarginProperty);
     BindingHelper.Bind(_contentPresenter, ContentPresenter.ContentProperty, this, ContentProperty);
     BindingHelper.Bind(_contentPresenter, ContentPresenter.ContentTemplateProperty, this, DataTemplateProperty);
     BindingHelper.Bind(_contentPresenter, ContentPresenter.ContentTemplateSelectorProperty, this, DataTemplateSelectorProperty);
     Content = content;
 }