void ShowServo(bool immediate = false)
        {
            uint delay = 500;

            if (immediate)
            {
                delay = 0;
            }
            UrlView.TranslateTo(0, 0, delay, Easing.SpringOut);
            ServoView.TranslateTo(0, 0, delay, Easing.SpringOut);
            StatusView.ScaleTo(1, delay, Easing.Linear);
            _viewModel.ToolbarHeight = (int)ServoView.Bounds.Top;
        }
Example #2
0
 public NSServoView(ServoView control)
 {
     _servoView = control;
     Object[] attributes =
     {
         NSOpenGLPixelFormatAttribute.DoubleBuffer,
         NSOpenGLPixelFormatAttribute.ClosestPolicy,
         NSOpenGLPixelFormatAttribute.ColorSize,                                 32,
         NSOpenGLPixelFormatAttribute.AlphaSize,                                  8,
         NSOpenGLPixelFormatAttribute.DepthSize,                                 24,
         NSOpenGLPixelFormatAttribute.StencilSize,                                8,
         NSOpenGLPixelFormatAttribute.OpenGLProfile,NSOpenGLProfile.Version3_2Core,
         0
     };
     pixelFormat   = new NSOpenGLPixelFormat(attributes);
     openGLContext = new NSOpenGLContext(pixelFormat, null);
     openGLContext.MakeCurrentContext();
 }
        void HideServo(bool immediate = false)
        {
            uint delay        = 500;
            var  deviceFactor = 1;
            var  offset       = 0.25;

            if (immediate)
            {
                delay = 0;
            }

            if (Device.RuntimePlatform == Device.macOS)
            {
                deviceFactor = -1;
                offset       = 0.5;
            }

            UrlView.TranslateTo(0, deviceFactor * offset * ServoView.Bounds.Height, delay, Easing.SpringIn);
            ServoView.TranslateTo(0, deviceFactor * ServoView.Bounds.Height, delay, Easing.SpringIn);
            StatusView.ScaleTo(0, delay, Easing.Linear);
        }