Esempio n. 1
0
        public override void ViewDidLayoutSubviews()
        {
            // Handle resize here (not in WillRotate) because in WillRotate we don't know
            // the resulting screen resolution.
            var toOrientation = ConvertInterfaceOrientation(Window.Current.ClientSize, InterfaceOrientation);
            var deviceRotated = toOrientation != Application.CurrentDeviceOrientation;

            Application.CurrentDeviceOrientation = toOrientation;
            // The texture stages get invalidated after device rotation. Rebind textures to fix it.
            PlatformRenderer.RebindTextures();
            // Vertex array objects also get invalidated.
            Mesh.InvalidateVertexArrayObjects();
            if (OnResize != null)
            {
                OnResize(this, new ResizeEventArgs {
                    DeviceRotated = deviceRotated
                });
            }
        }