Inheritance: System.Windows.FrameworkElement
Exemplo n.º 1
0
        /// <summary>
        /// Handles changes to the DataContextPiggyBack property.
        /// </summary>
        private static void OnDataContextPiggyBackChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            FrameworkElement targetElement = d as FrameworkElement;

            // whenever the targeElement DataContext is changed, copy the updated property
            // value to our MultiBinding.
            MultiBindings relay = GetMultiBindings(targetElement);

            relay.SetDataContext(targetElement.DataContext);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Invoked when the MultiBinding property is set on a framework element
        /// </summary>
        private static void OnMultiBindingsChanged(DependencyObject depObj, DependencyPropertyChangedEventArgs e)
        {
            FrameworkElement targetElement = depObj as FrameworkElement;

            // bind the target elements DataContext, to our DataContextPiggyBack property
            // this allows us to get property changed events when the targetElement
            // DataContext changes
            targetElement.SetBinding(DataContextPiggyBackProperty, new Binding());

            MultiBindings bindings = GetMultiBindings(targetElement);

            bindings.Initialize(targetElement);
        }
Exemplo n.º 3
0
 public static void SetMultiBindings(DependencyObject obj, MultiBindings value)
 {
     obj.SetValue(MultiBindingsProperty, value);
 }
 public static void SetMultiBindings(DependencyObject obj, MultiBindings value)
 {
     obj.SetValue(MultiBindingsProperty, value);
 }