private static bool SetFixedTranslateTransformCore(FrameworkElement element, bool canScrollHorizontally) { Debug.Assert(element != null); var parentScrollViewer = TableViewScrollViewer.GetParentScrollViewer(element) as ScrollViewer; if (parentScrollViewer == null) { return(false); } var fixedTransform = TableViewScrollViewer.GetStoredFixedTransform(parentScrollViewer); Debug.Assert(fixedTransform != null); if (canScrollHorizontally) { if (element.RenderTransform == fixedTransform) { element.ClearValue(UIElement.RenderTransformProperty); } } else { element.RenderTransform = fixedTransform; } return(true); }
internal static void SetFixedTranslateTransform(UIElement element, bool canScrollHorizontally) { if (element == null) { throw new ArgumentNullException("element"); } ScrollViewer parentScrollViewer = TableViewScrollViewer.GetParentScrollViewer(element) as ScrollViewer; if (parentScrollViewer != null) { Transform fixedTransform = TableViewScrollViewer.GetStoredFixedTransform(parentScrollViewer); Debug.Assert(fixedTransform != null); if (canScrollHorizontally) { if (element.RenderTransform == fixedTransform) { element.ClearValue(UIElement.RenderTransformProperty); } } else { element.RenderTransform = fixedTransform; } } }