public ZTextBufferWindow(ZWindowManager manager, FontAndColorService fontAndColorService) : base(manager, fontAndColorService) { this.normalFontFamily = new FontFamily("Cambria"); this.fixedFontFamily = new FontFamily("Consolas"); var zero = new FormattedText( textToFormat: "0", culture: CultureInfo.InstalledUICulture, flowDirection: FlowDirection.LeftToRight, typeface: new Typeface(normalFontFamily, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal), emSize: this.FontSize, foreground: Brushes.Black); this.fontCharSize = new Size(zero.Width, zero.Height); this.document = new FlowDocument { FontFamily = normalFontFamily, FontSize = this.FontSize, PagePadding = new Thickness(8.0) }; this.paragraph = new Paragraph(); this.document.Blocks.Add(this.paragraph); this.scrollViewer = new FlowDocumentScrollViewer { FocusVisualStyle = null, Document = this.document }; this.Children.Add(this.scrollViewer); }
public ZPairWindow( ZWindowManager manager, FontAndColorService fontAndColorService, ZWindow child1, ZWindow child2, ZWindowPosition child2Position, GridLength child2Size) : base(manager, fontAndColorService) { this.child1 = child1; this.child2 = child2; switch (child2Position) { case ZWindowPosition.Left: this.ColumnDefinitions.Add(new ColumnDefinition { Width = child2Size }); this.ColumnDefinitions.Add(new ColumnDefinition()); SetColumn(this.child1, 1); SetColumn(this.child2, 0); break; case ZWindowPosition.Right: this.ColumnDefinitions.Add(new ColumnDefinition()); this.ColumnDefinitions.Add(new ColumnDefinition { Width = child2Size }); SetColumn(this.child1, 0); SetColumn(this.child2, 1); break; case ZWindowPosition.Above: this.RowDefinitions.Add(new RowDefinition { Height = child2Size }); this.RowDefinitions.Add(new RowDefinition()); SetRow(this.child1, 1); SetRow(this.child2, 0); break; case ZWindowPosition.Below: this.RowDefinitions.Add(new RowDefinition()); this.RowDefinitions.Add(new RowDefinition { Height = child2Size }); SetRow(this.child1, 0); SetRow(this.child2, 1); break; } child1.SetParentWindow(this); child2.SetParentWindow(this); this.Children.Add(child1); this.Children.Add(child2); }
protected ZWindow(ZWindowManager manager, FontAndColorService fontAndColorService) { this.Manager = manager; this.fontAndColorService = fontAndColorService; this.foregroundThreadAffinitizedObject = new ForegroundThreadAffinitizedObject(); UseLayoutRounding = true; SnapsToDevicePixels = true; TextOptions.SetTextFormattingMode(this, TextFormattingMode.Display); TextOptions.SetTextRenderingMode(this, TextRenderingMode.Auto); }
public ZTextGridWindow(ZWindowManager manager, FontAndColorService fontAndColorService) : base(manager, fontAndColorService) { var zero = new FormattedText( textToFormat: "0", culture: CultureInfo.InstalledUICulture, flowDirection: FlowDirection.LeftToRight, typeface: new Typeface(new FontFamily("Consolas"), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal), emSize: this.FontSize, foreground: Brushes.Black); this.fontCharSize = new Size(zero.Width, zero.Height); this.textGrid = new ZTextGrid(this.FontSize); this.Children.Add(this.textGrid); }
public ZBlankWindow(ZWindowManager manager, FontAndColorService fontAndColorService) : base(manager, fontAndColorService) { }