Beispiel #1
0
        /// <summary>
        ///    Sets the scaling factor of the panel
        /// <param name="newScalingFactor">New scaling factor</param>
        /// </summary>
        public void SetScalingFactor(double newScalingFactor)
        {
            // Do not touch any user set render transform on the XAML element
            // if scaling is not necessary and was not enabled before
            if (newScalingFactor == 1.0f && _scalingFactor == 1.0f)
            {
                return;
            }

            _scalingFactor = newScalingFactor;

            Windows.UI.Xaml.UIElement element = Child;

            if (element == null)
            {
                return;
            }

            if (newScalingFactor == 1.0f)
            {
                element.RenderTransform = null;
                return;
            }

            Windows.UI.Xaml.Media.ScaleTransform newScaleTransform = new Windows.UI.Xaml.Media.ScaleTransform();
            newScaleTransform.ScaleX = newScalingFactor;
            newScaleTransform.ScaleY = newScalingFactor;

            element.RenderTransform = newScaleTransform;
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///MapUtilities_Metro/Lower Level/Callouts/MapCallout.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Nested);
 
            storyboardAppearance = (Windows.UI.Xaml.Media.Animation.Storyboard)this.FindName("storyboardAppearance");
            storyboardDisappearance = (Windows.UI.Xaml.Media.Animation.Storyboard)this.FindName("storyboardDisappearance");
            myGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("myGrid");
            gridScaleTransform = (Windows.UI.Xaml.Media.ScaleTransform)this.FindName("gridScaleTransform");
        }