Exemple #1
0
        private void InitAppBar()
        {
            StringResources stx = StringResources.Load("AppBar");

            List <ICommandBarElement> Btns = new List <ICommandBarElement>();

            if (GRConfig.System.EnableOneDrive)
            {
                AppBarButtonEx OneDriveBtn = UIAliases.CreateAppBarBtnEx(SegoeMDL2.Cloud, stx.Text("Sync"));

                ButtonOperation Op = new ButtonOperation(OneDriveBtn);
                Op.SetOp(Manager.OneDriveSync);
                Op.SetComplete(ThemePresets);

                Btns.Add(OneDriveBtn);
            }

            AppBarButton SaveBtn = UIAliases.CreateAppBarBtn(Symbol.Save, stx.Text("Save"));

            SaveBtn.Click += SaveBtn_Click;

            Btns.Add(SaveBtn);

            MajorControls = Btns.ToArray();
        }
Exemple #2
0
        protected void InitAppBar()
        {
            StringResources           stx  = StringResources.Load("AppBar");
            List <ICommandBarElement> Btns = new List <ICommandBarElement>();

            if (GRConfig.System.EnableOneDrive)
            {
                AppBarButtonEx  OneDriveBtn = UIAliases.CreateAppBarBtnEx(SegoeMDL2.Cloud, stx.Text("SyncBookmarks"));
                ButtonOperation SyncOp      = new ButtonOperation(OneDriveBtn);

                SyncOp.SetOp(OneDriveRsync);
                Btns.Add(OneDriveBtn);
            }

            JumpMarkBtn        = UIAliases.CreateAppBarBtn(Symbol.Tag, stx.Text("JumpToAnchor"));
            JumpMarkBtn.Click += JumpToBookmark;

            CRDirToggle ReaderDirBtn = new CRDirToggle(ThisBook)
            {
                Label      = stx.Str("ContentDirection"),
                Foreground = UIAliases.ContextColor,
                OnToggle   = ToggleDir
            };

            AppBarButtonEx ReloadBtn = UIAliases.CreateAppBarBtnEx(Symbol.Refresh, stx.Text("Reload"));

            ReloadBtn.Click += (sender, e) =>
            {
                ReloadBtn.IsLoading = true;
                new VolumeLoader(b =>
                {
                    SetTOC(b);
                    ReloadBtn.IsLoading = false;
                }).Load(ThisBook, false);
            };

            Btns.Add(ReaderDirBtn);
            Btns.Add(JumpMarkBtn);
            Btns.Add(ReloadBtn);

            MajorControls = Btns.ToArray();
        }
Exemple #3
0
        private void InitAppBar()
        {
            StringResources stx = StringResources.Load("AppBar");

            // Do nothing ( default ) / Ask / Pin Missing / Remove Missing
            PinPolicyBtn        = UIAliases.CreateAppBarBtn(SegoeMDL2.Pin, "Pin Policy");
            PinPolicyBtn.Click += RotatePolicy;
            UpdatePinPolicy(stx);

            if (GRConfig.System.EnableOneDrive)
            {
                AppBarButtonEx  OneDriveButton = UIAliases.CreateAppBarBtnEx(SegoeMDL2.Cloud, stx.Text("Sync"));
                ButtonOperation SyncOp         = new ButtonOperation(OneDriveButton);

                SyncOp.SetOp(OneDriveRsync, false);
                MajorControls = new ICommandBarElement[] { PinPolicyBtn, OneDriveButton };
            }
            else
            {
                MajorControls = new ICommandBarElement[] { PinPolicyBtn };
            }
        }