Inheritance: IDependencyProperty
コード例 #1
0
 public StarRateControl()
 {
     this.InitializeComponent();
     
     valueProperty = DependencyProperty.Register("Value", typeof(int), typeof(StarRateControl), new PropertyMetadata(3));
     
 }
コード例 #2
0
 private void VisibilityChangedCallback(DependencyObject sender, DependencyProperty dp)
 {
     if (Visibility == Visibility.Visible)
     {
         EntryBox.Text = FilterSting;
     }
 }
コード例 #3
0
        static SettingsEditor()
        {
            YScaleWidthProperty = DependencyProperty.Register("YScaleWidth", typeof(int), typeof(SettingsEditor), new PropertyMetadata(60));
            XScaleHeightProperty = DependencyProperty.Register("XScaleHeight", typeof(int), typeof(SettingsEditor), new PropertyMetadata(15));
            BorderThickness1Property = DependencyProperty.Register("BorderThickness1", typeof(int), typeof(SettingsEditor), new PropertyMetadata(1));
            BorderProperty = DependencyProperty.Register("Border", typeof(string), typeof(SettingsEditor), new PropertyMetadata("Black"));
            YScaleDockProperty = DependencyProperty.Register("YScaleDock", typeof(YScaleDock), typeof(SettingsEditor), new PropertyMetadata(YScaleDock.Right));
            ControlBackgroundProperty = DependencyProperty.Register("ControlBackground", typeof(string), typeof(SettingsEditor), new PropertyMetadata("White"));
            XScaleDockProperty = DependencyProperty.Register("XScaleDock", typeof(XScaleDock), typeof(SettingsEditor), new PropertyMetadata(XScaleDock.Bottom));
            CoordinateTypeProperty = DependencyProperty.Register("CoordinateType", typeof(CoordinateType), typeof(SettingsEditor), new PropertyMetadata(CoordinateType.Linear));
            CursorLinesProperty = DependencyProperty.Register("CursorLines", typeof(string), typeof(SettingsEditor), new PropertyMetadata("Gray"));
            CursorLinesThicknessProperty = DependencyProperty.Register("CursorLinesThickness", typeof(int), typeof(SettingsEditor), new PropertyMetadata(1));
            CursorLinesDashesProperty = DependencyProperty.Register("CursorLinesDashes", typeof(string), typeof(SettingsEditor), new PropertyMetadata(null));

            ScaleLineColorProperty = DependencyProperty.Register("ScaleLineColor", typeof(string), typeof(SettingsEditor), new PropertyMetadata("Gray"));
            ScaleLineThicknessProperty = DependencyProperty.Register("ScaleLineThickness", typeof(int), typeof(SettingsEditor), new PropertyMetadata(1));
            ScaleLineDashesProperty = DependencyProperty.Register("ScaleLineDashes", typeof(string), typeof(SettingsEditor), new PropertyMetadata(null));

            FontFamilyProperty = DependencyProperty.Register("FontFamily", typeof(string), typeof(SettingsEditor), new PropertyMetadata("Arial"));
            FontSizeProperty = DependencyProperty.Register("FontSize", typeof(int), typeof(SettingsEditor), new PropertyMetadata(10));

            widthArrayProperty = DependencyProperty.Register("widthArray", typeof(int[]), typeof(SettingsEditor), new PropertyMetadata(null));
            brushesProperty = DependencyProperty.Register("brushes", typeof(string[]), typeof(SettingsEditor), new PropertyMetadata(null));
            yScaleDocksProperty = DependencyProperty.Register("yScaleDocks", typeof(YScaleDock[]), typeof(SettingsEditor), new PropertyMetadata(null));
            xScaleDocksProperty = DependencyProperty.Register("xScaleDocks", typeof(XScaleDock[]), typeof(SettingsEditor), new PropertyMetadata(null));
            bgBrushesProperty = DependencyProperty.Register("bgBrushes", typeof(string[]), typeof(SettingsEditor), new PropertyMetadata(null));
            dockWidthArrayProperty = DependencyProperty.Register("dockWidthArray", typeof(int[]), typeof(SettingsEditor), new PropertyMetadata(null));
            coordinateTypesProperty = DependencyProperty.Register("coordinateTypes", typeof(CoordinateType[]), typeof(SettingsEditor), new PropertyMetadata(null));
            dashArrayProperty = DependencyProperty.Register("dashArray", typeof(string[]), typeof(SettingsEditor), new PropertyMetadata(null));
            fontNamesProperty = DependencyProperty.Register("fontNames", typeof(string[]), typeof(SettingsEditor), new PropertyMetadata(null));
            fontSizesProperty = DependencyProperty.Register("fontSizes", typeof(int[]), typeof(SettingsEditor), new PropertyMetadata(null));
        }
コード例 #4
0
        /// <summary>
        /// Inherited code: Requires comment.
        /// </summary>
        /// <param name="obj">Inherited code: Requires comment 1.</param>
        /// <param name="dependencyProperty">Inherited code: Requires comment 2.</param>
        /// <param name="suspend">Inherited code: Requires comment 3.</param>
        private static void SuspendHandler(this DependencyObject obj, DependencyProperty dependencyProperty, bool suspend)
        {
            if (_suspendedHandlers.ContainsKey(obj))
            {
                Dictionary<DependencyProperty, bool> suspensions = _suspendedHandlers[obj];

                if (suspend)
                {
                    Debug.Assert(!suspensions.ContainsKey(dependencyProperty), "Suspensions should not contain the property!");

                    // true = dummy value
                    suspensions[dependencyProperty] = true;
                }
                else
                {
                    Debug.Assert(suspensions.ContainsKey(dependencyProperty), "Suspensions should contain the property!");
                    suspensions.Remove(dependencyProperty);
                    if (suspensions.Count == 0)
                    {
                        _suspendedHandlers.Remove(obj);
                    }
                }
            }
            else
            {
                Debug.Assert(suspend, "suspend should be true!");
                _suspendedHandlers[obj] = new Dictionary<DependencyProperty, bool>();
                _suspendedHandlers[obj][dependencyProperty] = true;
            }
        }
コード例 #5
0
 static TextBlockFontSize()
 {
     FontSizeProperty = DependencyProperty.Register("FontSize",
         typeof(int),
         typeof(TextBlockFontSize),
         new PropertyMetadata(TextBlock.FontSizeProperty, null));
 }
        /// <summary>
        /// Starts animating a dependency property of a framework element to a 
        /// target value.
        /// </summary>
        /// <param name="target">The element to animate.</param>
        /// <param name="animatingDependencyProperty">The dependency property to
        /// animate.</param>
        /// <param name="propertyPath">The path of the dependency property to 
        /// animate.</param>
        /// <param name="targetValue">The value to animate the dependency
        /// property to.</param>
        /// <param name="timeSpan">The duration of the animation.</param>
        /// <param name="easingFunction">The easing function to uses to
        /// transition the data points.</param>
        public static void BeginAnimation(
            this FrameworkElement target,
            DependencyProperty animatingDependencyProperty,
            string propertyPath,
            object targetValue,
            TimeSpan timeSpan,
            EasingFunctionBase easingFunction)
        {
            Storyboard storyBoard = target.Resources[GetStoryboardKey(propertyPath)] as Storyboard;

            if (storyBoard != null)
            {
                // Save current value
                object currentValue = target.GetValue(animatingDependencyProperty);
                storyBoard.Stop();
                // RestoreAsync that value so it doesn't snap back to its starting value
                target.SetValue(animatingDependencyProperty, currentValue);
                target.Resources.Remove(GetStoryboardKey(propertyPath));
            }

            storyBoard = CreateStoryboard(target, animatingDependencyProperty, propertyPath, ref targetValue, timeSpan, easingFunction);

            storyBoard.Completed += 
                (source, args) =>
                    {
                        storyBoard.Stop();
                        target.SetValue(animatingDependencyProperty, targetValue);
                        target.Resources.Remove(GetStoryboardKey(propertyPath));
                    };

            target.Resources.Add(GetStoryboardKey(propertyPath), storyBoard);
            storyBoard.Begin();
        }
コード例 #7
0
ファイル: GroupListViewItem.cs プロジェクト: GJian/UWP-master
 private void OnHeaderPresenterContentChanged(DependencyObject sender, DependencyProperty dp)
 {
     if (headerPresenter.Content != Header)
     {
         headerPresenter.Content = Header;
     }
 }
コード例 #8
0
        void SetValueDp(DependencyProperty property, object value, [System.Runtime.CompilerServices.CallerMemberName] String p = null)
        {
            SetValue(property, value);

            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(p));
        }
 static FrameworkElementAttachedProperties()
 {
     ObserveProperty = DependencyProperty.RegisterAttached("Observe", typeof(bool), typeof(FrameworkElementAttachedProperties), new PropertyMetadata(null, new PropertyChangedCallback(OnObserveChanged)));
     ObservedWidthProperty = DependencyProperty.RegisterAttached("ObservedWidth", typeof(double), typeof(FrameworkElementAttachedProperties), new PropertyMetadata(null, null));
     ObservedHeightProperty = DependencyProperty.RegisterAttached("ObservedHeight", typeof(double), typeof(FrameworkElementAttachedProperties), new PropertyMetadata(null, null));
     LoadedCommandProperty = DependencyProperty.RegisterAttached("LoadedCommand", typeof(ICommand), typeof(FrameworkElementAttachedProperties), new PropertyMetadata(null, OnLoadedCommandChanged));
 }
コード例 #10
0
ファイル: GroupListView.cs プロジェクト: GJian/UWP-master
        private void OnItemsSourceChanged(DependencyObject sender, DependencyProperty dp)
        {
            if (this.ItemsSource != null && ItemsSource is IGroupCollection)
            {
                groupCollection = (ItemsSource as IGroupCollection);
            }

            if (groupHeadersGrid != null)
            {
                groupHeadersGrid.Children.Clear();
            }

            groupDic.Clear();

            if (currentTopGroupHeader != null)
            {
                currentTopGroupHeader.DataContext = null;
                currentTopGroupHeader.Visibility = Visibility.Collapsed;
                if (groupHeadersGrid != null)
                {
                    groupHeadersGrid.Children.Add(currentTopGroupHeader);
                }
            }
            else
            {
                if (groupHeadersGrid != null)
                {
                    currentTopGroupHeader = CreateGroupHeader(null);
                    currentTopGroupHeader.Visibility = Visibility.Collapsed;
                    groupHeadersGrid.Children.Add(currentTopGroupHeader);
                }
            }
        }
コード例 #11
0
 /// <summary>
 /// Sets a binding from code
 /// </summary>
 /// <param name="element"></param>
 /// <param name="property"></param>
 /// <param name="source"></param>
 /// <param name="path"></param>
 /// <param name="converter"></param>
 public static void SetBinding(FrameworkElement element, DependencyProperty property, object source, string path, IValueConverter converter = null)
 {
     Binding binding = new Binding();
     binding.Source = source;
     binding.Path = new PropertyPath(path);
     binding.Converter = converter;
     element.SetBinding(property, binding);
 }
コード例 #12
0
 private static void RefreshBinding(DependencyObject target, DependencyProperty property)
 {
     BindingExpression binding = target.ReadLocalValue(property) as BindingExpression;
     if (binding != null && binding.ParentBinding != null)
     {
         BindingOperations.SetBinding(target, property, binding.ParentBinding);
     }
 }
コード例 #13
0
ファイル: MorseInput.xaml.cs プロジェクト: mjcdev/MorseCoder
 private void SetValueDp(DependencyProperty property, object value, [CallerMemberName] string propertyName = null)
 {
     SetValue(property, value);
     if (PropertyChanged != null)
     {
         PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     }
 }
コード例 #14
0
 private void OnMinWindowWidthPropertyChanged(DependencyObject sender, DependencyProperty dp)
 {
     var window = CoreApplication.GetCurrentView()?.CoreWindow;
     if (window != null)
     {
         IsActive = window.Bounds.Width >= MinWindowWidth;
     }
 }
コード例 #15
0
        public static void BeginAnimation(this DependencyObject obj, DependencyProperty property, PointAnimation animation)
        {
            animation.EnableDependentAnimation = true;

            if (property == MapBase.CenterPointProperty)
            {
                BeginAnimation(obj, "CenterPoint", animation);
            }
        }
コード例 #16
0
 void HeaderChanged(DependencyObject sender, DependencyProperty prop)
 {
     string header = (string)sender.GetValue(prop);
     //Double check to make sure that we don't needlessly realize the header presenter
     if (!string.IsNullOrEmpty(Header) && _header == null)
     {
         _header = (ContentPresenter)GetTemplateChild("HeaderPresenter"); //This will realize the element
     }
 }
コード例 #17
0
ファイル: fontchooser.xaml.cs プロジェクト: mhusen/Eto
 public FontPropertyMetadata(
     object defaultValue,
     PropertyChangedCallback changeCallback,
     DependencyProperty targetProperty
     )
     : base(defaultValue, changeCallback)
 {
     TargetProperty = targetProperty;
 }
コード例 #18
0
 public static void BindProperty(FrameworkElement element, object source,
     string path, DependencyProperty property, BindingMode mode)
 {
     var binding = new Binding();
     binding.Path = new PropertyPath(path);
     binding.Source = source;
     binding.Mode = mode;
     element.SetBinding(property, binding);
 }
コード例 #19
0
 public static void BindProperty(Control control, object source, string path,
     DependencyProperty property, BindingMode mode)
 {
     var binding = new Binding();
     binding.Path = new PropertyPath(path);
     binding.Source = source;
     binding.Mode = mode;
     control.SetBinding(property, binding);
 }
コード例 #20
0
 void SetValueDp(DependencyProperty property, object value,
     [System.Runtime.CompilerServices.CallerMemberNameAttribute] String p = null)
 {
     SetValue(property, value);
         //if (PropertyChanged != null)
         //{
         //    PropertyChanged(this, new DependencyPropertyChangedEventArgs(value, p));
         //}
 }
コード例 #21
0
 // Methods
 public static void EnsureBindingUpToDate(DependencyObject target, DependencyProperty dp)
 {
     BindingExpression expression = target.ReadLocalValue(dp) as BindingExpression;
     if (expression != null)
     {
         target.ClearValue(dp);
         target.SetValue(dp, expression);
     }
 }
コード例 #22
0
ファイル: ViewMapper.cs プロジェクト: ShibaJS/Shiba
 public PropertyMap(string name, NativeProperty dependencyProperty, Type valueType,
                    Func <object, object> converter = null, bool isTwoWay = false) : base(name, valueType, null)
 {
     DependencyProperty = dependencyProperty;
     Converter          = converter;
     IsTwoWay           = isTwoWay;
     PropertyType       = valueType;
     Action             = SetValue;
 }
コード例 #23
0
        protected ActionCollection GetActionCollection(DependencyProperty collectionProperty)
        {
            ActionCollection actionCollection = (ActionCollection)this.GetValue(collectionProperty);
            if (actionCollection == null)
            {
                actionCollection = new ActionCollection();
                this.SetValue(collectionProperty, actionCollection);
            }

            return actionCollection;
        }
コード例 #24
0
 /// <summary>
 /// Inherited code: Requires comment.
 /// </summary>
 /// <param name="obj">Inherited code: Requires comment 1.</param>
 /// <param name="dependencyProperty">Inherited code: Requires comment 2.</param>
 /// <returns>Inherited code: Requires comment 3.</returns>
 public static bool IsHandlerSuspended(this DependencyObject obj, DependencyProperty dependencyProperty)
 {
     if (_suspendedHandlers.ContainsKey(obj))
     {
         return _suspendedHandlers[obj].ContainsKey(dependencyProperty);
     }
     else
     {
         return false;
     }
 }
コード例 #25
0
        static RangeSlider()
        {
            UpperValueProperty = DependencyProperty.Register("UpperValue",
                                        typeof(double),
                                        typeof(RangeSlider),
                                        new PropertyMetadata(1.0));

            LowerValueProperty = DependencyProperty.Register("LowerValue",
                                        typeof(double),
                                        typeof(RangeSlider),
                                        new PropertyMetadata(0.0));
        }
コード例 #26
0
 private void AnimatedVisibilityChangedCallback(DependencyObject sender, DependencyProperty dp)
 {
     if (AnimatedVisibility == Visibility.Visible)
     {
         Visibility = Visibility.Visible;
         ((Storyboard)Resources["ShowAnimation"]).Begin();                
     }
     else
     {
         ((Storyboard)Resources["HideAnimation"]).Begin();
     }
 }
コード例 #27
0
 /// <summary>
 /// Inherited code: Requires comment.
 /// </summary>
 /// <param name="obj">Inherited code: Requires comment 1.</param>
 /// <param name="property">Inherited code: Requires comment 2.</param>
 /// <param name="value">Inherited code: Requires comment 3.</param>
 public static void SetValueNoCallback(this DependencyObject obj, DependencyProperty property, object value)
 {
     obj.SuspendHandler(property, true);
     try
     {
         obj.SetValue(property, value);
     }
     finally
     {
         obj.SuspendHandler(property, false);
     }
 }
コード例 #28
0
        public DependencyPropertySubscription(T element, DependencyProperty dependencyProperty)
        {
            Element            = element;
            DependencyProperty = dependencyProperty;

            var sourceBinding = new Binding()
            {
                Path = new PropertyPath("Value"), Source = this, Mode = BindingMode.TwoWay
            };

            element.SetBinding(DependencyProperty, sourceBinding);
        }
コード例 #29
0
 public DependencyPropertyInfo(
     DependencyProperty property,
     string name,
     Type ownerType,
     string displayName,
     bool isAttached)
 {
     Property = property;
     Name = name;
     OwnerType = ownerType;
     DisplayName = displayName;
     IsAttached = isAttached;
 }
コード例 #30
0
        static GradientButton() {
            Color1Property =
                DependencyProperty.Register("Color1",
                    typeof(Color),
                    typeof(GradientButton),
                    new PropertyMetadata(Colors.White, OnColorChanged));

            Color2Property =
                DependencyProperty.Register("Color2",
                    typeof(Color),
                    typeof(GradientButton),
                    new PropertyMetadata(Colors.Black, OnColorChanged));
        }
コード例 #31
0
        static GradientButtonUC() {
            Color1Property =
                DependencyProperty.Register("Color1",
                    typeof(Color),
                    typeof(GradientButtonUC),
                    new PropertyMetadata(Colors.White));

            Color2Property =
                DependencyProperty.Register("Color2",
                    typeof(Color),
                    typeof(GradientButtonUC),
                    new PropertyMetadata(Colors.Black));
        }
コード例 #32
0
ファイル: GroupListView1.cs プロジェクト: GJian/UWP-master
        private void OnItemsSourceChanged(DependencyObject sender, DependencyProperty dp)
        {
            groupCollection = null;
            if (this.ItemsSource != null && ItemsSource is IGroupCollection)
            {
                groupCollection = (ItemsSource as IGroupCollection);
            }

            if (currentTopGroupHeader != null)
            {
                currentTopGroupHeader.DataContext = null;
                currentTopGroupHeader.Visibility = Visibility.Collapsed;
            }
        }
コード例 #33
0
 /// <summary>
 /// Get the value for the specified dependency property on the specific instance at
 /// the highest precedence level under the specified one.
 /// E.G. If a property has a value both on the Animation, Local and Default
 /// precedences, and the given precedence is Animation, then the Local value is returned.
 /// </summary>
 /// <param name="instance">The instance on which the property is attached</param>
 /// <param name="property">The dependency property to get</param>
 /// <param name="precedence">The value precedence under which to fetch a value</param>
 /// <returns></returns>
 internal static (object value, DependencyPropertyValuePrecedences precedence) GetValueUnderPrecedence(this DependencyObject instance, DependencyProperty property, DependencyPropertyValuePrecedences precedence)
 {
     return(GetStore(instance).GetValueUnderPrecedence(property, precedence));
 }
コード例 #34
0
 /// <summary>
 /// Clears the value for the specified dependency property on the specified instance.
 /// </summary>
 /// <param name="instance">The instance on which the property is attached</param>
 /// <param name="property">The dependency property to get</param>
 /// <param name="precedence">The value precedence to assign</param>
 internal static void ClearValue(this DependencyObject instance, DependencyProperty property, DependencyPropertyValuePrecedences precedence)
 {
     SetValue(instance, property, DependencyProperty.UnsetValue, precedence);
 }
コード例 #35
0
 /// <summary>
 /// Sets the value of the specified dependency property on the specified instance.
 /// </summary>
 /// <param name="instance">The instance on which the property is attached</param>
 /// <param name="property">The dependency property to get</param>
 /// <param name="value">The value to set</param>
 /// <param name="precedence">The value precedence to assign</param>
 public static void SetValue(this object instance, DependencyProperty property, object value, DependencyPropertyValuePrecedences?precedence)
 {
     GetStore(instance).SetValue(property, value, precedence ?? DependencyPropertyValuePrecedences.Local);
 }
コード例 #36
0
 /// <summary>
 /// Get the value for the specified dependency property on the specific instance at the specified precedence level
 /// </summary>
 /// <param name="instance">The instance on which the property is attached</param>
 /// <param name="property">The dependency property to get</param>
 /// <param name="precedence">The value precedence to fetch</param>
 /// <returns></returns>
 public static object GetValue(this object instance, DependencyProperty property, DependencyPropertyValuePrecedences?precedence)
 {
     return(GetStore(instance).GetValue(property, precedence));
 }
コード例 #37
0
 internal static DependencyPropertyValuePrecedences GetCurrentHighestValuePrecedence(this DependencyObject dependencyObject, DependencyProperty property)
 {
     return(GetStore(dependencyObject).GetCurrentHighestValuePrecedence(property));
 }
コード例 #38
0
 /// <summary>
 /// Gets the value for the specified dependency property on the specified instance.
 /// </summary>
 /// <param name="instance">The instance on which the property is attached</param>
 /// <param name="property">The dependency property to get</param>
 /// <returns>The dependency property value</returns>
 public static object GetValue(this object instance, DependencyProperty property)
 {
     return(GetStore(instance).GetValue(property));
 }
コード例 #39
0
 void SetEnumProperty(winXaml.DependencyProperty dstProperty, BindableProperty srcProperty)
 {
     Control.SetValue(dstProperty, (int)Element.GetValue(srcProperty));
 }
コード例 #40
0
        private static void RegisterProperty(Type ownerType, string name, DependencyProperty newProperty)
        {
            ResetGetPropertyCache(ownerType, name);

            _registry.Add(ownerType, name, newProperty);
        }
コード例 #41
0
 /// <summary>
 /// Gets the value for the specified dependency property on the specific instance at
 /// the specified precedence.  As opposed to GetValue, this will not fall back to the highest
 /// precedence if this precedence is currently unset and will return unset value.
 /// </summary>
 /// <param name="instance">The instance on which the property is attached</param>
 /// <param name="property">The dependency property to get</param>
 /// <param name="precedence">The value precedence at which to fetch a value</param>
 /// <returns></returns>
 internal static object GetPrecedenceSpecificValue(this DependencyObject instance, DependencyProperty property, DependencyPropertyValuePrecedences precedence)
 {
     return(GetStore(instance).GetValue(property, precedence, true));
 }
コード例 #42
0
 /// <summary>
 /// Determines if the specified dependency property is set.
 /// A property is set whenever a value (including null) is assigned to it.
 /// </summary>
 /// <param name="dependencyObject">The instance on which the property is attached</param>
 /// <param name="property">The dependency property to test</param>
 /// <returns>True if the dependency property is set. False otherwise.</returns>
 internal static bool IsDependencyPropertySet(this DependencyObject dependencyObject, DependencyProperty property)
 {
     return(GetStore(dependencyObject)
            .GetCurrentHighestValuePrecedence(property) != DependencyPropertyValuePrecedences.DefaultValue);
 }
コード例 #43
0
        /// <summary>
        /// Binds this wrapper object's exposed WPF DependencyProperty with the wrapped UWP object's DependencyProperty
        /// for what effectively works as a regular one- or two-way binding.
        /// </summary>
        /// <param name="propertyName">the registered name of the dependency property</param>
        /// <param name="wpfProperty">the DependencyProperty of the wrapper</param>
        /// <param name="uwpProperty">the related DependencyProperty of the UWP control</param>
        /// <param name="converter">a converter, if one's needed</param>
        /// <param name="direction">indicates that the binding should be one or two directional.  If one way, the Uwp control is only updated from the wrapper.</param>
        public void Bind(string propertyName, System.Windows.DependencyProperty wpfProperty, WUX.DependencyProperty uwpProperty, object converter = null, System.ComponentModel.BindingDirection direction = System.ComponentModel.BindingDirection.TwoWay)
        {
            if (direction == System.ComponentModel.BindingDirection.TwoWay)
            {
                var binder = new WUX.Data.Binding()
                {
                    Source    = this,
                    Path      = new WUX.PropertyPath(propertyName),
                    Converter = (WUX.Data.IValueConverter)converter
                };
                WUX.Data.BindingOperations.SetBinding(ChildInternal, uwpProperty, binder);
            }

            var rebinder = new System.Windows.Data.Binding()
            {
                Source    = ChildInternal,
                Path      = new System.Windows.PropertyPath(propertyName),
                Converter = (System.Windows.Data.IValueConverter)converter
            };

            System.Windows.Data.BindingOperations.SetBinding(this, wpfProperty, rebinder);
        }
コード例 #44
0
 /// <summary>
 /// Register for changes dependency property changes notifications.
 /// </summary>
 /// <param name="instance">The instance that owns the property</param>
 /// <param name="property">The property to observe</param>
 /// <param name="callback">The callback</param>
 /// <returns>A disposable that will unregister the callback when disposed.</returns>
 public static IDisposable RegisterDisposablePropertyChangedCallback(this object instance, DependencyProperty property, PropertyChangedCallback callback)
 {
     return(GetStore(instance).RegisterPropertyChangedCallback(property, callback));
 }
コード例 #45
0
        public DependencyPropertyDetailsCollection(Type ownerType, ManagedWeakReference ownerReference, DependencyProperty dataContextProperty, DependencyProperty templatedParentProperty)
        {
            _ownerType      = ownerType;
            _ownerReference = ownerReference;

            _dataContextProperty     = dataContextProperty;
            _templatedParentProperty = templatedParentProperty;
        }
コード例 #46
0
 /// <summary>
 /// Coerces the value of the specified dependency property.
 /// This is accomplished by invoking any CoerceValueCallback function specified in
 /// property metadata for the dependency property as it exists on the calling DependencyObject.
 /// </summary>
 /// <param name="instance">The instance on which the property is attached</param>
 /// <param name="property">The dependency property to get</param>
 internal static void CoerceValue(this object instance, DependencyProperty property)
 {
     GetStore(instance).CoerceValue(property);
 }
コード例 #47
0
        public DependencyPropertyDetailsCollection(Type ownerType, ManagedWeakReference ownerReference, DependencyProperty dataContextProperty, DependencyProperty templatedParentProperty)
        {
            _ownerType      = ownerType;
            _ownerReference = ownerReference;

            var propertiesForType = DependencyProperty.GetPropertiesForType(ownerType);

            if (propertiesForType.Length != 0)
            {
                _minId = propertiesForType[0].UniqueId;
                _maxId = propertiesForType[propertiesForType.Length - 1].UniqueId;

                var entriesLength = _maxId - _minId + 1;
                var entries       = _pool.Rent(entriesLength);

                // Entries are pre-sorted by the DependencyProperty.GetPropertiesForType method
                AssignEntries(entries, entriesLength);
            }

            _dataContextProperty     = dataContextProperty;
            _templatedParentProperty = templatedParentProperty;
        }
コード例 #48
0
ファイル: ViewMapper.cs プロジェクト: ShibaJS/Shiba
 public PropertyMap(string name, NativeProperty dependencyProperty, Type valueType, Type propertyType,
                    Func <object, object> converter = null, bool isTwoWay = false) :
     this(name, dependencyProperty, valueType, converter, isTwoWay)
 {
     PropertyType = propertyType;
 }