コード例 #1
0
        private void InitAppBar()
        {
            StringResources stx       = StringResources.Load("Settings", "Message", "ContextMenu");
            AppBarButton    LogoutBtn = UIAliases.CreateAppBarBtn(SegoeMDL2.ChevronLeft, stx.Text("Account_Logout"));

            LogoutBtn.Click += async(s, e) =>
            {
                bool Yes = false;
                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            stx.Str("ConfirmLogout", "Message")
                                            , () => Yes = true
                                            , stx.Str("Yes", "Message"), stx.Str("No", "Message")
                                            ));

                if (Yes)
                {
                    X.Singleton <IMember>(XProto.SHMember).Logout();
                    ControlFrame.Instance.GoBack();
                    ControlFrame.Instance.BackStack.Remove(PageId.SH_USER_INFO);
                }
            };

            SecondaryIconButton ManageAuth = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.Manage, stx.Text("ManageAuths", "ContextMenu"));

            ManageAuth.Click += (s, e) => ControlFrame.Instance.SubNavigateTo(this, () => new ManageAuth());

            MajorControls    = new ICommandBarElement[] { LogoutBtn };
            Major2ndControls = new ICommandBarElement[] { ManageAuth };
        }
コード例 #2
0
ファイル: ONSPageExt.cs プロジェクト: MewX/wenku10
        private void InitAppBar()
        {
            StringResources stx = StringResources.Load("AppResources", "ContextMenu");

            ActivyBtn = new AppBarButtonEx()
            {
                Icon       = new SymbolIcon(Symbol.Message),
                Label      = stx.Text("Messages"),
                Foreground = new SolidColorBrush(LayoutSettings.RelativeMajorBackgroundColor)
            };

            ActivyBtn.Click += ToggleActivities;

            AppBarButton UploadBtn = UIAliases.CreateAppBarBtn(SegoeMDL2.Upload, stx.Text("SubmitScript"));

            UploadBtn.Click += (s, e) => ControlFrame.Instance.SubNavigateTo(Page, () => new ScriptUpload(UploadExit));

            SecondaryIconButton MAuthBtn = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.Manage, stx.Text("ManageAuths", "ContextMenu"));

            MAuthBtn.Click += ManageAuths;

            MajorControls = new ICommandBarElement[] { ActivyBtn, UploadBtn };

            LoginBtn        = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.ChevronRight, stx.Text("Login"));
            LoginBtn.Click += (s, e) => SHLoginOrInfo();

#if DEBUG || TESTING
            StringResources     sts          = StringResources.Load("Settings");
            SecondaryIconButton ChangeServer = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.DirectAccess, sts.Text("Advanced_Server"));
            ChangeServer.Click += async(s, e) =>
            {
                ValueHelpInput VH = new ValueHelpInput(
                    Shared.ShRequest.Server.ToString()
                    , sts.Text("Advanced_Server"), "Address"
                    );

                await Popups.ShowDialog(VH);

                if (VH.Canceled)
                {
                    return;
                }

                try
                {
                    Shared.ShRequest.Server     = new Uri(VH.Value);
                    ONSSystem.Config.ServiceUri = VH.Value;
                }
                catch (Exception) { }
            };

            Major2ndControls = new ICommandBarElement[] { LoginBtn, MAuthBtn, ChangeServer };
#else
            Major2ndControls = new ICommandBarElement[] { LoginBtn, MAuthBtn };
#endif
        }
コード例 #3
0
        private void InitAppBar()
        {
            StringResources stx      = StringResources.Load("AppBar");
            AppBarButton    OpenFile = UIAliases.CreateAppBarBtn(SegoeMDL2.OpenFile, stx.Text("OpenZone"));

            OpenFile.Click += OpenFile_Click;

            SecondaryIconButton SpiderEditor = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.Edit, stx.Text("SpiderEdit", "ContextMenu"));

            SpiderEditor.Click += (s, e) => ControlFrame.Instance.NavigateTo(PageId.PROC_PANEL, () => new ProcPanelWrapper(null));

            MajorControls    = new ICommandBarElement[] { OpenFile };
            Major2ndControls = new ICommandBarElement[] { SpiderEditor };
        }
コード例 #4
0
ファイル: MasterCommandManager.cs プロジェクト: MewX/wenku10
        private void CreateSystemCommands()
        {
            List <ICommandBarElement> Btns = new List <ICommandBarElement>();

            SecondaryIconButton SettingsBtn = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.Settings, stx.Text("Settings", "AppBar"));

            SettingsBtn.Click += CreateCmdHandler(PageId.MAIN_SETTINGS, () => new global::wenku10.Pages.Settings.MainSettings());

            SecondaryIconButton BackupBtn = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.UpdateRestore, stx.Text("BackupAndRestore", "AppBar"));

            BackupBtn.Click += BackupBtn_Click;

            SecondaryIconButton ConsoleBtn = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.CommandPrompt, stx.Text("ConsoleMode", "AppBar"));

            ConsoleBtn.Click += ConsoleBtn_Click;

            AboutBtn = new SecretSwipeButton(SegoeMDL2.Info)
            {
                Label  = stx.Text("About", "AppBar"),
                Label2 = "(゚∀゚)",
                Glyph2 = SegoeMDL2.Accept
            };

            AboutBtn.PendingClick  += CreateCmdHandler(PageId.ABOUT, () => new About());
            AboutBtn.CanSwipe       = true;
            AboutBtn.OnIndexUpdate += (s, i) => Logger.Log(AboutBtn.Label2, i.ToString(), LogType.DEBUG);

            Btns.Add(ConsoleBtn);
            Btns.Add(BackupBtn);
            Btns.Add(new AppBarSeparator());
            Btns.Add(SettingsBtn);
            Btns.Add(AboutBtn);

            if (MainStage.Instance.IsPhone)
            {
                SecondaryIconButton ExitBtn = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.ChromeClose, stx.Text("Exit", "AppBar"));
                ExitBtn.Click += (s, e) =>
                {
                    Windows.ApplicationModel.Core.CoreApplication.Exit();
                };
                Btns.Add(ExitBtn);
            }

            SystemCommands = Btns.ToArray();
        }
コード例 #5
0
ファイル: MasterCommandManager.cs プロジェクト: MewX/wenku10
        private void CreateCommonCommands()
        {
            SecondaryIconButton HistoryBtn = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.History, stx.Text("History", "NavigationTitles"));

            // Goto Explorer, Auto Select History
            HistoryBtn.Click += (s, e) => ControlFrame.Instance.NavigateTo(
                PageId.MASTER_EXPLORER,
                () => new MasterExplorer(),
                P => (( MasterExplorer )P).NavigateToDataSource(typeof(HistoryData))
                );

            SecondaryIconButton ManagePinsBtn = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.Pinned, stx.Text("ManagePins", "NavigationTitles"));

            ManagePinsBtn.Click += CreateCmdHandler(PageId.MANAGE_PINS, () => new ManagePins());

            SecondaryIconButton EBWinBtn = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.Dictionary, "EBWin");

            EBWinBtn.Click += CreateCmdHandler(async(s, e) =>
            {
                await Popups.ShowDialog(new EBDictSearch(new Model.Text.Paragraph("")));
            });

            CommonCommands = new ICommandBarElement[] { HistoryBtn, EBWinBtn, ManagePinsBtn };
        }
コード例 #6
0
        private void InitAppBar()
        {
            StringResources stx = StringResources.Load("AppBar", "AppResources", "Settings");

            AddBtn        = UIAliases.CreateAppBarBtn(Symbol.Add, stx.Str("AddComment"));
            AddBtn.Click += OpenInputBox;

            SubmitBtn        = UIAliases.CreateAppBarBtn(Symbol.Send, stx.Text("Button_Post", "AppResources"));
            SubmitBtn.Click += SubmitBtn_Click;

            DiscardBtn        = UIAliases.CreateAppBarBtn(Symbol.Delete, "Discard");
            DiscardBtn.Click += CloseInputBox;

            CommentControls = new ICommandBarElement[] { AddBtn };
            InputControls   = new ICommandBarElement[] { SubmitBtn, DiscardBtn };

            MajorControls = CommentControls;

            SecondaryIconButton LogoutBtn = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.ChevronLeft, stx.Text("Account_Logout", "Settings") + " ( twitter )");

            LogoutBtn.Click += LogoutBtn_Click;

            Major2ndControls = new ICommandBarElement[] { LogoutBtn };
        }