internal double GetScaleFactor() { if (_ScreenSpaceScaler == null) { _ScreenSpaceScaler = GetScreenSpaceScaler(); if (_ScreenSpaceScaler != null) { _ScreenSpaceScaler.ScaleFactorChanged += ScreenSpaceScaler_ScaleFactorChanged; } } double screenScaleFactor = 1.0; if (_ScreenSpaceScaler != null && _ScreenSpaceScaler.ScaleFactor > 0.0) { screenScaleFactor = _ScreenSpaceScaler.ScaleFactor; } return screenScaleFactor; }
protected override void OnVisualParentChanged(DependencyObject oldParent) { base.OnVisualParentChanged(oldParent); m_ScreenSpaceScaler = null; }