aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Windows/DialogWindow.xaml
blob: 683391afd6f93766d84d26a2332b400e9ced6c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<mahapps:MetroWindow x:Class="Tango.Scripting.IDE.Windows.DialogWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Tango.Scripting.IDE.Windows"
        mc:Ignorable="d"
        Title="Some Title" Height="720" Width="1280" 
        SizeToContent="WidthAndHeight" 
        ResizeMode="NoResize" 
        ShowMaxRestoreButton="False" 
        ShowMinButton="False" 
        ShowCloseButton="False" 
        BorderThickness="1" BorderBrush="Gray" TitleCaps="False">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Tango.Scripting.IDE;component/Themes/DarkThemesColors.xaml"/>
                <ResourceDictionary Source="/Tango.Scripting.IDE;component/Themes/ButtonStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    
    <Grid>
        
    </Grid>
</mahapps:MetroWindow>
ing Tango.Scripting.Editors.Rendering; using Tango.Scripting.Editors.Utils; namespace Tango.Scripting.Editors.Rendering { /// <summary> /// Renders a ruler at a certain column. /// </summary> sealed class ColumnRulerRenderer : IBackgroundRenderer { Pen pen; int column; TextView textView; public static readonly Color DefaultForeground = Colors.LightGray; public ColumnRulerRenderer(TextView textView) { if (textView == null) throw new ArgumentNullException("textView"); this.pen = new Pen(new SolidColorBrush(DefaultForeground), 1); this.pen.Freeze(); this.textView = textView; this.textView.BackgroundRenderers.Add(this); } public KnownLayer Layer { get { return KnownLayer.Background; } } public void SetRuler(int column, Pen pen) { if (this.column != column) { this.column = column; textView.InvalidateLayer(this.Layer); } if (this.pen != pen) { this.pen = pen; textView.InvalidateLayer(this.Layer); } } public void Draw(TextView textView, System.Windows.Media.DrawingContext drawingContext) { if (column < 1) return; double offset = textView.WideSpaceWidth * column; Size pixelSize = PixelSnapHelpers.GetPixelSize(textView); double markerXPos = PixelSnapHelpers.PixelAlign(offset, pixelSize.Width); markerXPos -= textView.ScrollOffset.X; Point start = new Point(markerXPos, 0); Point end = new Point(markerXPos, Math.Max(textView.DocumentHeight, textView.ActualHeight)); drawingContext.DrawLine(pen, start, end); } } }