private static System.Windows.Media.Stretch ToWpfStretch(this Windows.UI.Xaml.Media.Stretch stretch) { Debug.Assert((int)System.Windows.Media.Stretch.None == (int)Windows.UI.Xaml.Media.Stretch.None); Debug.Assert((int)System.Windows.Media.Stretch.Fill == (int)Windows.UI.Xaml.Media.Stretch.Fill); Debug.Assert((int)System.Windows.Media.Stretch.Uniform == (int)Windows.UI.Xaml.Media.Stretch.Uniform); Debug.Assert((int)System.Windows.Media.Stretch.UniformToFill == (int)Windows.UI.Xaml.Media.Stretch.UniformToFill); return((System.Windows.Media.Stretch)stretch); }
void UpdateAspect() { Stretch aspect = Element.Aspect; WStretch stretch = WStretch.None; switch (aspect) { case Stretch.None: stretch = WStretch.None; break; case Stretch.Fill: stretch = WStretch.Fill; break; case Stretch.Uniform: stretch = WStretch.Uniform; break; case Stretch.UniformToFill: stretch = WStretch.UniformToFill; break; } Control.Stretch = stretch; if (aspect == Stretch.Uniform) { Control.HorizontalAlignment = HorizontalAlignment.Center; Control.VerticalAlignment = VerticalAlignment.Center; } else { Control.HorizontalAlignment = HorizontalAlignment.Left; Control.VerticalAlignment = VerticalAlignment.Top; } }
public static void UpdateSurfaceBrushOptions(this Windows.UI.Composition.CompositionSurfaceBrush surfaceBrush, Windows.UI.Xaml.Media.Stretch stretch, Windows.UI.Xaml.Media.AlignmentX alignX, Windows.UI.Xaml.Media.AlignmentY alignY, Windows.UI.Composition.ScalarKeyFrameAnimation alignXAnimation = null, Windows.UI.Composition.ScalarKeyFrameAnimation alignYAnimation = null) { }