示例#1
0
        private void RectangleSelection_LayoutUpdated(object sender, object e)
        {
            if (scrollViewer == null)
            {
                scrollViewer = DependencyObjectHelpers.FindChild <ScrollViewer>(uiElement, sv => sv.VerticalScrollMode != ScrollMode.Disabled);
            }

            if (scrollViewer != null)
            {
                uiElement.LayoutUpdated -= RectangleSelection_LayoutUpdated;
            }
        }
示例#2
0
        private void RectangleSelection_LayoutUpdated(object sender, object e)
        {
            if (scrollViewer == null)
            {
                scrollViewer = DependencyObjectHelpers.FindChild <ScrollViewer>(uiElement);
            }

            if (scrollViewer != null)
            {
                uiElement.LayoutUpdated -= RectangleSelection_LayoutUpdated;
            }
        }
示例#3
0
 private async void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(ViewModel.SelectedElementTheme))
     {
         foreach (var theme in ViewModel.CustomThemes)
         {
             var container = AppThemeSelectionGridView.ContainerFromItem(theme);
             if (container != null)
             {
                 var item = DependencyObjectHelpers.FindChild <ThemeSampleDisplayControl>(container);
                 if (item != null)
                 {
                     await item.ReevaluateThemeResourceBinding();
                 }
             }
         }
     }
 }
 private void InitEvents(object sender, RoutedEventArgs e)
 {
     if (!uiElement.IsLoaded)
     {
         uiElement.Loaded += InitEvents;
     }
     else
     {
         uiElement.Loaded             -= InitEvents;
         uiElement.PointerPressed     += RectangleSelection_PointerPressed;
         uiElement.PointerReleased    += RectangleSelection_PointerReleased;
         uiElement.PointerCaptureLost += RectangleSelection_PointerReleased;
         uiElement.PointerCanceled    += RectangleSelection_PointerReleased;
         uiElement.LoadingRow         += RectangleSelection_LoadingRow;
         uiElement.UnloadingRow       += RectangleSelection_UnloadingRow;
         scrollBar = DependencyObjectHelpers.FindChild <ScrollBar>(uiElement);
     }
 }
示例#5
0
        private void InitEvents(object sender, RoutedEventArgs e)
        {
            if (!uiElement.IsLoaded)
            {
                uiElement.Loaded += InitEvents;
            }
            else
            {
                uiElement.Loaded             -= InitEvents;
                uiElement.PointerPressed     += RectangleSelection_PointerPressed;
                uiElement.PointerReleased    += RectangleSelection_PointerReleased;
                uiElement.PointerCaptureLost += RectangleSelection_PointerReleased;
                uiElement.PointerCanceled    += RectangleSelection_PointerReleased;

                scrollViewer = DependencyObjectHelpers.FindChild <ScrollViewer>(uiElement, sv => sv.VerticalScrollMode != ScrollMode.Disabled);
                if (scrollViewer == null)
                {
                    uiElement.LayoutUpdated += RectangleSelection_LayoutUpdated;
                }
            }
        }