Beispiel #1
0
        public void UpdateTarget()
        {
            FailIfDisposed();
            var value = _sourceAdapter.GetValue();

            ForwardValueToTargetIfNotNoValue(value);
        }
        private ICollection <object> GetSourceItemsAsCollection()
        {
            var sourceItemsObject     = _sourceAdapter.GetValue();
            var sourceItemsCollection = ConvertToCollection(sourceItemsObject);

            return(sourceItemsCollection);
        }
Beispiel #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));
        }
 public object GetValue()
 {
     FailIfDisposed();
     if (_valueAdapter == null)
     {
         return(SettingsConstants.NoValue);
     }
     return(_valueAdapter.GetValue());
 }
        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);
        }
Beispiel #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);
        }
Beispiel #8
0
 public IEnumerable GetItems()
 {
     FailIfDisposed();
     return(new[] { _valueAdapter.GetValue() });
 }
Beispiel #9
0
 public object GetValue()
 {
     return(_valueAdapter.GetValue());
 }
Beispiel #10
0
 private void RefreshCollectionView()
 {
     UnbindFromCollectionView();
     _collectionView = (ICollectionView)_collectionViewAdapter.GetValue();
     BindToCollectionView();
 }