// Clear value-related things that this class caches
            public void ClearValueRelatedCacheItems() 
            {
                _subProperties = null;
                _collection = null;
                _standardValues = null;
                _standardValuesExclusive = null;
                _converter = null;
                _commonValueType = null;
                _source = null;
                _isReadOnly = null;
                _valueSerializer = null;

                ClearSubValueRelatedCacheItems();

                _parent.OnPropertyChanged("StandardValues");
                _parent.OnPropertyChanged("StandardValuesExclusive");
                _parent.OnPropertyChanged("Converter");
                _parent.OnPropertyChanged("CommonValueType");
                _parent.OnPropertyChanged("IsReadOnly");

                // The following properties are only exposed by ModelPropertyEntry, not PropertyEntry.
                // People should bind to these properties through the PropertyValue.
                // However, if they ---- up in Xaml, the binding will still work and if that happens
                // we should try to update them when things change.
                _parent.OnPropertyChanged("SubProperties");
                _parent.OnPropertyChanged("Collection");
                _parent.OnPropertyChanged("Source");
            }
Пример #2
0
 public override string ConvertToString(XAML3.IValueSerializerContext context, XAML3.ValueSerializer serializer, object instance)
 {
     try
     {
         return(serializer.ConvertToString(instance, context));
     }
     catch (Exception ex)
     {
         if (CriticalExceptions.IsCriticalException(ex))
         {
             throw;
         }
         throw CreateException(SR.Get(SRID.TypeConverterFailed2, instance, typeof(string)), ex);
     }
 }
Пример #3
0
 public override bool CanConvertFromString(string value, IValueSerializerContext context)
 {
     return(ValueSerializer.GetSerializerFor(typeof(Type), context) != null);
 }