Ejemplo n.º 1
0
#pragma warning restore CA1000 // Do not declare static members on generic types

        #endregion

        #region Ctors

        internal AbstractPropertyState(DependencyObject element)
        {
            m_PropertyValues = new Dictionary <DependencyProperty, object>();
            Uid = GenericPropertyStateHelper <TState, TElement, TProperty> .GetUidWithNamespace(element);

            Mode = GetMode(element);
            Type = element.GetType();
        }
Ejemplo n.º 2
0
 public override object ProvideValue(IServiceProvider serviceProvider)
 {
     if (serviceProvider == null)
     {
         throw new ArgumentNullException(nameof(serviceProvider));
     }
     if (!(serviceProvider.GetService(typeof(IProvideValueTarget)) is IProvideValueTarget provideValueTarget))
     {
         return(this);
     }
     return(GenericPropertyStateHelper <TState, TElement, TProperty> .ProvideValue(
                provideValueTarget.TargetObject as DependencyObject,
                provideValueTarget.TargetProperty as DependencyProperty,
                Default, Binding) ?? this);
 }