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; } }
private void RectangleSelection_LayoutUpdated(object sender, object e) { if (scrollViewer == null) { scrollViewer = DependencyObjectHelpers.FindChild <ScrollViewer>(uiElement); } if (scrollViewer != null) { uiElement.LayoutUpdated -= RectangleSelection_LayoutUpdated; } }
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); } }
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; } } }