예제 #1
0
        public Calculator()
        {
            this.InitializeComponent();

            m_doAnimate = false;
            m_isLastAnimatedInScientific = false;
            m_isLastAnimatedInProgrammer = false;
            m_resultAnimate      = false;
            HistoryButtonPressed = new DelegateCommand(ToggleHistoryFlyout);

            SetFontSizeResources();
            LoadResourceStrings();

            if (LocalizationService.GetInstance().IsRtlLayout())
            {
                HistoryButton.HorizontalAlignment = HorizontalAlignment.Left;
            }

            m_displayFlyout = (MenuFlyout)(Resources["DisplayContextMenu"]);
            var resLoader = AppResourceProvider.GetInstance();

            // UNO TODO
            // CopyMenuItem.Text = resLoader.GetResourceString("copyMenuItem");
            // PasteMenuItem.Text = resLoader.GetResourceString("pasteMenuItem");
        }
예제 #2
0
        internal bool GetShouldBeNarrow()
        {
            MenuFlyoutPresenter spPresenter = GetParentMenuFlyoutPresenter();

            var shouldBeNarrow = false;

            if (spPresenter != null)
            {
                MenuFlyout spParentFlyout = spPresenter.GetParentMenuFlyout();

                if (spParentFlyout != null)
                {
                    shouldBeNarrow =
                        (spParentFlyout.InputDeviceTypeUsedToOpen == FocusInputDeviceKind.Mouse) ||
                        (spParentFlyout.InputDeviceTypeUsedToOpen == FocusInputDeviceKind.Pen) ||
                        (spParentFlyout.InputDeviceTypeUsedToOpen == FocusInputDeviceKind.Keyboard);
                }
            }

            return(shouldBeNarrow);
        }