Exemple #1
0
        private static void CommandProperty_Changed(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            DataPager element = dependencyObject as DataPager;

            if (element != null)
            {
                PageChangedBehavior behavior = GetOrCreateBehavior(element);
                behavior.Command = e.NewValue as ICommand;
            }
        }
Exemple #2
0
        private static PageChangedBehavior GetOrCreateBehavior(DataPager element)
        {
            PageChangedBehavior behavior = element.GetValue(PageChangedBehaviorProperty) as PageChangedBehavior;

            if (behavior == null)
            {
                behavior = new PageChangedBehavior(element);
                element.SetValue(PageChangedBehaviorProperty, behavior);
            }

            return(behavior);
        }
Exemple #3
0
 public static void SetTextChangedCommandBehavior(DependencyObject obj,
                                                  PageChangedBehavior value)
 {
     obj.SetValue(PageChangedBehaviorProperty, value);
 }