Пример #1
0
        public void UpdateTarget()
        {
            FailIfDisposed();
            var value = _sourceAdapter.GetValue();

            ForwardValueToTargetIfNotNoValue(value);
        }
Пример #2
0
        private ICollection <object> GetSourceItemsAsCollection()
        {
            var sourceItemsObject     = _sourceAdapter.GetValue();
            var sourceItemsCollection = ConvertToCollection(sourceItemsObject);

            return(sourceItemsCollection);
        }
Пример #3
0
        public object GetValue()
        {
            var target          = _targetAdapter.GetValue();
            var convertedTarget = _converter.ConvertTarget(target);

            return(convertedTarget);
        }
        public object GetValue()
        {
            FailIfDisposed();
            var sourceItemsSource = _sourceItemsSourceAdapter.GetValue();

            return(sourceItemsSource as ICollectionView
                   ?? CollectionViewSource.GetDefaultView(sourceItemsSource));
        }
Пример #5
0
 public object GetValue()
 {
     FailIfDisposed();
     if (_valueAdapter == null)
     {
         return(SettingsConstants.NoValue);
     }
     return(_valueAdapter.GetValue());
 }
Пример #6
0
        private IValueAdapter CreateValueAdapter()
        {
            var dataContext = _dataContextAdapter.GetValue();

            if (dataContext == null)
            {
                return(null);
            }
            var valueAdapter = ValueAdapterFactory.CreateAdapter(dataContext, _propertyInDataContext);

            if (valueAdapter != null)
            {
                valueAdapter.ValueChangedCallback = _valueChangedCallback;
            }
            return(valueAdapter);
        }
Пример #7
0
        public object GetValue()
        {
            try
            {
                return(_targetAdapter.GetValue());
            }
            catch (Exception e)
            {
                switch (_exceptionHandler(ValueAdapterAction.GetValue, e))
                {
                case ExceptionHandlerResult.SwallowException:
                    break;

                case ExceptionHandlerResult.RethrowException:
                    throw;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
            return(SettingsConstants.NoValue);
        }
Пример #8
0
 public IEnumerable GetItems()
 {
     FailIfDisposed();
     return(new[] { _valueAdapter.GetValue() });
 }
Пример #9
0
 public object GetValue()
 {
     return(_valueAdapter.GetValue());
 }
Пример #10
0
 private void RefreshCollectionView()
 {
     UnbindFromCollectionView();
     _collectionView = (ICollectionView)_collectionViewAdapter.GetValue();
     BindToCollectionView();
 }