Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
990
scroll in pivotgrid
posted

Dears,

Is there any event handler for the pivotgrid scroll?

 

Thanks,

Parents
  • 7922
    posted

    Hi

    There is not scroll event but you can find the scroll bar from control and to listen for thier scroll event. Below is a snippet how to find the scroll bar. The names of the bars you can see from generic.xaml from pivotgrid control template.

     void PivotGridContainer_Loaded(object sender, RoutedEventArgs e)
            {
    
                ScrollBar vert = GetObject(PGrid, "VerticalScrollBar"as ScrollBar;
                ScrollBar horiz = GetObject(PGrid, "HorizontalScrollBar"as ScrollBar;
            }         private DependencyObject GetObject(DependencyObject obj, string name)         {             DependencyObject child = null;             int coutn = VisualTreeHelper.GetChildrenCount(obj);             for (int index = 0; index < coutn; index++)             {                 child = VisualTreeHelper.GetChild(obj, index);                 if (child is FrameworkElement && (child as FrameworkElement).Name == name)                 {                     return child;                 }                 child = GetObject(child, name);                 if (child != null)                 {                     return child;                 }             }             return child;         }

     

    Todor

Reply Children