Ejemplo n.º 1
0
        private void UpdateTrigger(Windows.Graphics.Display.DisplayOrientations orientation)
        {
            var qualifiers = Windows.ApplicationModel.Resources.Core.ResourceContext.GetForCurrentView().QualifierValues;
            var isOnMobile = qualifiers.ContainsKey("DeviceFamily") && qualifiers["DeviceFamily"].ToLowerInvariant() == "Mobile".ToLowerInvariant();

            if (orientation == Windows.Graphics.Display.DisplayOrientations.None)
            {
                SetActive(false);
            }
            else if (orientation == Windows.Graphics.Display.DisplayOrientations.Landscape ||
                     orientation == Windows.Graphics.Display.DisplayOrientations.LandscapeFlipped)
            {
                if (isOnMobile)
                {
                    SetActive(Orientation == Orientations.LandscapeMobile);
                }
                else
                {
                    SetActive(Orientation == Orientations.Landscape);
                }
            }
            else if (orientation == Windows.Graphics.Display.DisplayOrientations.Portrait ||
                     orientation == Windows.Graphics.Display.DisplayOrientations.PortraitFlipped)
            {
                if (isOnMobile)
                {
                    SetActive(Orientation == Orientations.PortraitMobile);
                }
                else
                {
                    SetActive(Orientation == Orientations.Portrait);
                }
            }
        }
Ejemplo n.º 2
0
 private void UpdateTrigger(Windows.Graphics.Display.DisplayOrientations orientation)
 {
     if (orientation == Windows.Graphics.Display.DisplayOrientations.None)
     {
         IsActive = false;
     }
     else if (orientation == Windows.Graphics.Display.DisplayOrientations.Landscape ||
              orientation == Windows.Graphics.Display.DisplayOrientations.LandscapeFlipped)
     {
         IsActive = Orientation == Orientations.Landscape;
     }
     else if (orientation == Windows.Graphics.Display.DisplayOrientations.Portrait ||
              orientation == Windows.Graphics.Display.DisplayOrientations.PortraitFlipped)
     {
         IsActive = Orientation == Orientations.Portrait;
     }
 }
Ejemplo n.º 3
0
 private void UpdateTrigger(Windows.Graphics.Display.DisplayOrientations orientation)
 {
     if (orientation == Windows.Graphics.Display.DisplayOrientations.None)
     {
         SetTriggerValue(false);
     }
     else if (orientation == Windows.Graphics.Display.DisplayOrientations.Landscape ||
              orientation == Windows.Graphics.Display.DisplayOrientations.LandscapeFlipped)
     {
         SetTriggerValue(Orientation == Orientations.Landscape);
     }
     else if (orientation == Windows.Graphics.Display.DisplayOrientations.Portrait ||
              orientation == Windows.Graphics.Display.DisplayOrientations.PortraitFlipped)
     {
         SetTriggerValue(Orientation == Orientations.Portrait);
     }
 }