Exemple #1
0
        private void ToggleAlternativesPopup()
        {
            if (AlternativesPopup.IsOpen)
            {
                AlternativesPopup.IsOpen = false;
            }
            else
            {
                if (!EnableAlternativesPopup || !_key.AlternativeActions.Any())
                {
                    return;
                }

                var defaultKey = new VirtualKeyAction(_keyboard, _keySet, _key.DefaultAction, KeyWidth);
                IEnumerable <VirtualKeyAction> alternativeKeys = _key.AlternativeActions.Select(a => new VirtualKeyAction(_keyboard, _keySet, a, KeyWidth));

                var alternativesSelection = new AlternateKeySelection(defaultKey, alternativeKeys)
                {
                    FlowDirection = _popupFlowDirection
                };

                AlternativesPopup.Child  = alternativesSelection;
                AlternativesPopup.IsOpen = true;
            }
        }
        private void ToggleAlternativesPopup()
        {
            if (AlternativesPopup.IsOpen)
                AlternativesPopup.IsOpen = false;
            else
            {
                if (!EnableAlternativesPopup || !_key.AlternativeActions.Any())
                    return;

                var defaultKey = new VirtualKeyAction(_keyboard, _keySet, _key.DefaultAction, KeyWidth);
                IEnumerable<VirtualKeyAction> alternativeKeys = _key.AlternativeActions.Select(a => new VirtualKeyAction(_keyboard, _keySet, a, KeyWidth));

                var alternativesSelection = new AlternateKeySelection(defaultKey, alternativeKeys) {
                    FlowDirection = _popupFlowDirection
                };

                AlternativesPopup.Child = alternativesSelection;
                AlternativesPopup.IsOpen = true;
            }
        }