public void UpdateTextViews() { if (LeftTextView != null && RightTextView != null) { CanvasRoot.Invalidate(); } }
public DiffMapScrollControl() { this.InitializeComponent(); CanvasRoot.SizeChanged += (s, e) => { CanvasRoot.Invalidate(); }; }
public TextControl() { this.InitializeComponent(); _textFormat = new CanvasTextFormat { FontFamily = "Consolas", FontSize = 12, WordWrapping = CanvasWordWrapping.NoWrap }; CanvasRoot.CreateResources += (s, e) => { _defaultForegroundBrush = new CanvasSolidColorBrush(s, _defaultForegroundColor); _addedForegroundBrush = new CanvasSolidColorBrush(s, _addedForegroundColor); _removedForegroundBrush = new CanvasSolidColorBrush(s, _removedForegroundColor); var stops = new CanvasGradientStop[4] { new CanvasGradientStop { Color = _defaultBackgroundColor, Position = 0 }, new CanvasGradientStop { Color = _defaultBackgroundColor, Position = 0.5f }, new CanvasGradientStop { Color = _nullBackgroundColor, Position = 0.5f }, new CanvasGradientStop { Color = _nullBackgroundColor, Position = 1 } }; _nullBrush = new CanvasLinearGradientBrush(s, stops, CanvasEdgeBehavior.Mirror, CanvasAlphaMode.Premultiplied) { StartPoint = new System.Numerics.Vector2(0, 0), EndPoint = new System.Numerics.Vector2(4, 4) }; }; CanvasRoot.SizeChanged += (s, e) => { CanvasRoot.Invalidate(); }; }
internal void UpdateText() { if (Text == null) { return; } CanvasRoot.Height = Text.LineCount * LineHeight; CanvasRoot.Invalidate(); GutterRoot.Text = this.Text; GutterRoot.UpdateHeight(CanvasRoot.Height); if (DiffMap != null) { DiffMap.UpdateTextViews(); } Text.ScrollToLineRequested -= Text_ScrollToLineRequested; Text.ScrollToLineRequested += Text_ScrollToLineRequested; }
public GutterControl() { this.InitializeComponent(); _textFormat = new CanvasTextFormat { FontFamily = "Consolas", FontSize = 12, WordWrapping = CanvasWordWrapping.NoWrap, HorizontalAlignment = CanvasHorizontalAlignment.Right }; CanvasRoot.CreateResources += (s, e) => { _defaultForegroundBrush = new CanvasSolidColorBrush(s, _defaultForegroundColor); }; CanvasRoot.SizeChanged += (s, e) => { CanvasRoot.Invalidate(); }; }
public void UpdateHeight(double height) { CanvasRoot.Height = height; CanvasRoot.Invalidate(); }
internal void UpdateText() { CanvasRoot.Invalidate(); }