private async void SetAccelerScroll() { var ACSConf = GRConfig.ContentReader.AccelerScroll; ACScroll = new AccelerScroll { ProgramBrake = true, TrackAutoAnchor = ACSConf.TrackAutoAnchor, Brake = ACSConf.Brake, BrakeOffset = ACSConf.BrakeOffset, BrakingForce = ACSConf.BrakingForce, AccelerMultiplier = ACSConf.AccelerMultiplier, TerminalVelocity = ACSConf.TerminalVelocity }; ACScroll.UpdateOrientation(App.ViewControl.DispOrientation); StringResources stx = StringResources.Load("Settings", "Message"); ToggleAcceler = UIAliases.CreateMenuFlyoutItem(stx.Text("Enabled"), new SymbolIcon(Symbol.Accept)); ToggleAcceler.Click += (s, e) => ToggleAccelerScroll(); CallibrateAcceler = new MenuFlyoutItem() { Text = stx.Text("Callibrate") }; CallibrateAcceler.Click += CallibrateAcceler_Click; AccelerMenu.Items.Add(ToggleAcceler); AccelerMenu.Items.Add(CallibrateAcceler); if (ACScroll.Available && !ACSConf.Asked) { bool EnableAccel = false; await Popups.ShowDialog(UIAliases.CreateDialog( stx.Str("EnableAccelerScroll", "Message") , () => EnableAccel = true , stx.Str("Yes", "Message"), stx.Str("No", "Message") )); ACSConf.Asked = true; ACSConf.Enable = EnableAccel; } ToggleAccelerScroll(ACSConf.Enable); UpdateAccelerDelta(); }
protected override void SetTemplate() { StringResources stx = StringResources.Load("AppBar", "AppResources", "ContextMenu", "Resources"); OpenDefault = new MenuFlyoutItem() { Text = "Open", FontWeight = FontWeights.Bold }; OpenDefault.Click += OpenDefault_Click; OpenDefault.Text = stx.Text("Open", "ContextMenu"); Edit = new MenuFlyoutItem() { Text = stx.Text("Edit", "ContextMenu") }; Edit.Click += Edit_Click; GotoTOC = new MenuFlyoutItem() { Text = stx.Text("TOC") }; GotoTOC.Click += GotoTOC_Click; GotoReader = new MenuFlyoutItem() { Text = stx.Str("Kb_For_ContentReader", "Resources") }; GotoReader.Click += GotoReader_Click; GotoInfo = new MenuFlyoutItem() { Text = stx.Text("BookInfoView") }; GotoInfo.Click += GotoInfo_Click; DefaultTOC = UIAliases.CreateMenuFlyoutItem(stx.Text("TOC"), new SymbolIcon(Symbol.Accept)); DefaultTOC.Click += DefaultTOC_Click; DefaultReader = UIAliases.CreateMenuFlyoutItem(stx.Str("Kb_For_ContentReader", "Resources"), new SymbolIcon(Symbol.Accept)); DefaultReader.Click += DefaultReader_Click; DefaultInfo = UIAliases.CreateMenuFlyoutItem(stx.Text("BookInfoView"), new SymbolIcon(Symbol.Accept)); DefaultInfo.Click += DefaultInfo_Click; BrowserBtn = new MenuFlyoutItem() { Text = stx.Text("OpenInBrowser") }; BrowserBtn.Click += BrowserBtn_Click; XRBKBtn = new MenuFlyoutItem() { Text = "XRBK" }; XRBKBtn.Click += ExportXRBKBtn_Click; ExportBtn = new MenuFlyoutSubItem() { Text = stx.Text("Export") }; ExportBtn.Items.Add(XRBKBtn); OpenWith = new MenuFlyoutSubItem() { Text = stx.Text("OpenWith", "ContextMenu") }; OpenWith.Items.Add(GotoTOC); OpenWith.Items.Add(GotoReader); OpenWith.Items.Add(GotoInfo); PinToStart = new MenuFlyoutItem() { Text = stx.Text("PinToStart", "ContextMenu") }; PinToStart.Click += PinToStart_Click; ContextMenu = new MenuFlyout(); ContextMenu.Items.Add(OpenDefault); ContextMenu.Items.Add(Edit); ContextMenu.Items.Add(new MenuFlyoutSeparator()); ContextMenu.Items.Add(PinToStart); ContextMenu.Items.Add(ExportBtn); ContextMenu.Items.Add(new MenuFlyoutSeparator()); ContextMenu.Items.Add(OpenWith); ChangeDefault = new MenuFlyoutSubItem() { Text = stx.Text("ChangeDefault", "ContextMenu") }; ChangeDefault.Items.Add(DefaultTOC); ChangeDefault.Items.Add(DefaultReader); ChangeDefault.Items.Add(DefaultInfo); ContextMenu.Items.Add(ChangeDefault); ContextMenu.Items.Add(BrowserBtn); DefaultAction.PropertyChanged += DefaultAction_PropertyChanged; }