示例#1
0
        public void OpenLockscreen()
        {
            if (_passcodePanel != null && _clientArea != null)
            {
                if (_passcodePanel.DataContext == null)
                {
                    var viewModel = new LockscreenViewModel();
                    _passcodePanel.DataContext   = viewModel;
                    viewModel.PasscodeIncorrect += _passcodePanel.OnPasscodeIncorrect;
                }
                _passcodePanel.Visibility = Visibility.Visible;
                var page = Content as PhoneApplicationPage;
                if (page != null)
                {
                    _passcodePanel.ParentPage = page;
                    SetRootFrameBinding();
                    page.IsHitTestVisible = false;

                    if (!_stateExists)
                    {
                        _stateExists         = true;
                        _isSystemTrayVisible = SystemTray.IsVisible;
                        SystemTray.IsVisible = false;
                        if (page.ApplicationBar != null)
                        {
                            if (_buttons.Count == 0)
                            {
                                foreach (var button in page.ApplicationBar.Buttons)
                                {
                                    _buttons.Add(button);
                                }
                            }

                            if (_menuItems.Count == 0)
                            {
                                foreach (var menuItem in page.ApplicationBar.MenuItems)
                                {
                                    _menuItems.Add(menuItem);
                                }
                            }
                            //page.ApplicationBar.IsVisible = false;
                            page.ApplicationBar.Buttons.Clear();
                            page.ApplicationBar.MenuItems.Clear();
                        }
                        else
                        {
                            page.ApplicationBar = new ApplicationBar();
                            //page.ApplicationBar.IsVisible = false;
                            _removeApplicationBar = true;
                        }
                        _previousColor                      = page.ApplicationBar.BackgroundColor;
                        _previousOpacity                    = page.ApplicationBar.Opacity;
                        page.ApplicationBar.Opacity         = 1.0;
                        page.ApplicationBar.BackgroundColor = Colors.Transparent;
                    }
                }
                _passcodePanel.FocusPasscode();
            }
        }
示例#2
0
        private void OptimizeFullHD()
        {
            var gotFocusTransformY = TransformYDefault;

#if WP8
            switch (Application.Current.Host.Content.ScaleFactor)
            {
            case 100:       //Lumia 820
                gotFocusTransformY = TransformYDefault;
                break;

            case 112:       //Lumia 535
                gotFocusTransformY = TransformY112;
                break;

            case 150:       //HTC 8X

                // Lumia 730 softwarebuttons
                var appBar = new ApplicationBar();
                if (appBar.DefaultSize == 67.0)
                {
                    gotFocusTransformY = TransformY150Software;
                    break;
                }

                gotFocusTransformY = TransformY150;
                break;

            case 160:       //Lumia 925, 1020 (WXGA)
                gotFocusTransformY = TransformYDefault;
                break;

            case 225:       // Lumia 1520, Lumia 930
                var deviceName = DeviceStatus.DeviceName;
                if (!string.IsNullOrEmpty(deviceName))
                {
                    deviceName = deviceName.Replace("-", string.Empty).ToLowerInvariant();

                    //Lumia 1320, 1520
                    if (    //deviceName.StartsWith("rm934")      // Lumia 1320
                            //|| deviceName.StartsWith("rm935")
                            //|| deviceName.StartsWith("rm936")
                        deviceName.StartsWith("rm937") ||    // Lumia 1520
                        deviceName.StartsWith("rm938") ||
                        deviceName.StartsWith("rm939") ||
                        deviceName.StartsWith("rm940"))
                    {
                        var stateService = IoC.Get <IStateService>();

                        if (LockscreenViewModel.IsSimple(stateService))
                        {
                            gotFocusTransformY = -88.0;
                            break;
                        }

                        gotFocusTransformY = TransformY6Inch;
                        break;
                    }
                }

                // other FullHD
                gotFocusTransformY = TransformYDefault;
                break;
            }
#endif

            _gotFocusTransformY = gotFocusTransformY;
        }