public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Windows.Application.LoadComponent(this, new System.Uri("/FBReader.App;component/Controls/ThreePagePanel.xaml", System.UriKind.Relative)); this.RootGrid = ((System.Windows.Controls.Grid)(this.FindName("RootGrid"))); this.FirstPage = ((System.Windows.Controls.Canvas)(this.FindName("FirstPage"))); this.SecondPage = ((System.Windows.Controls.Canvas)(this.FindName("SecondPage"))); this.ThirdPage = ((System.Windows.Controls.Canvas)(this.FindName("ThirdPage"))); this.SelectionPolygon = ((System.Windows.Shapes.Polygon)(this.FindName("SelectionPolygon"))); this.LeftSelectionItem = ((FBReader.App.Controls.SelectionItemControl)(this.FindName("LeftSelectionItem"))); this.RightSelectionItem = ((FBReader.App.Controls.SelectionItemControl)(this.FindName("RightSelectionItem"))); this.SelectionActions = ((FBReader.App.Controls.SelectionActionsControl)(this.FindName("SelectionActions"))); }
private void BuildSelectionItem(SelectionItemControl control, double leftOffset, double topOffset, double height) { double lineIntervalCoef = Convert.ToDouble(AppSettings.Default.FontSettings.FontInterval); lineIntervalCoef = lineIntervalCoef >= 1 ? 1 : lineIntervalCoef; leftOffset = Screen.RoundScalePixel(leftOffset); topOffset = Screen.RoundScalePixel(topOffset); height = Screen.RoundScalePixel(height * lineIntervalCoef); control.Margin = new Thickness(leftOffset, topOffset + height * (1 - lineIntervalCoef), 0, 0); control.SelectionHeight = height; control.Visibility = Visibility.Visible; }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Windows.Application.LoadComponent(this, new System.Uri("/FBReader.App;component/Controls/ThreePagePanel.xaml", System.UriKind.Relative)); this.RootGrid = ((System.Windows.Controls.Grid)(this.FindName("RootGrid"))); this.FirstPage = ((System.Windows.Controls.Canvas)(this.FindName("FirstPage"))); this.SecondPage = ((System.Windows.Controls.Canvas)(this.FindName("SecondPage"))); this.ThirdPage = ((System.Windows.Controls.Canvas)(this.FindName("ThirdPage"))); this.SelectionPolygon = ((System.Windows.Shapes.Polygon)(this.FindName("SelectionPolygon"))); this.LeftSelectionItem = ((FBReader.App.Controls.SelectionItemControl)(this.FindName("LeftSelectionItem"))); this.RightSelectionItem = ((FBReader.App.Controls.SelectionItemControl)(this.FindName("RightSelectionItem"))); this.SelectionActions = ((FBReader.App.Controls.SelectionActionsControl)(this.FindName("SelectionActions"))); }