-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMainWindow.xaml
90 lines (76 loc) · 4.85 KB
/
MainWindow.xaml
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProverbTeleprompter"
xmlns:Controls="clr-namespace:ProverbTeleprompter.Controls"
xmlns:Helpers="clr-namespace:ProverbTeleprompter.Helpers" mc:Ignorable="d"
x:Class="ProverbTeleprompter.MainWindow"
x:Name="LayoutRoot"
Title="Proverb Teleprompter"
Height="{Controls:SettingBinding MainWindowHeight}"
Width="{Controls:SettingBinding MainWindowWidth}"
Top="{Controls:SettingBinding MainWindowTop}"
Left="{Controls:SettingBinding MainWindowLeft}"
WindowStyle="None"
WindowState="{Binding MainWindowState, Mode=TwoWay}" Foreground="Black" ResizeMode="CanResize"
d:DesignHeight="900" d:DesignWidth="900" Icon="ProverbTeleprompterLogo.ico"
>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Resources.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border RenderTransformOrigin="0.5,0.5" Background="{Binding BackgroundColor}">
<Border.RenderTransform>
<TransformGroup>
<RotateTransform x:Name="MainRotate" Angle="0" CenterX="0" CenterY="0"/>
<ScaleTransform x:Name="MainScale" ScaleX="{Binding MainWindowScaleX}"
ScaleY="{Binding MainWindowScaleY}" CenterX="0" CenterY="0" />
</TransformGroup>
</Border.RenderTransform>
<Grid x:Name="MainTextGrid" PreviewMouseMove="Grid_PreviewMouseMove"
Margin="{Binding OuterLeftRightMargin}">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Controls:ScrollViewerExt x:Name="MainScroller" Template="{DynamicResource ScrollViewerControlTemplate1}"
VerticalOffsetExt="{Binding MainScrollerVerticalOffset, Mode=TwoWay}"
Focusable="False" ExtentHeightExt="{Binding MainScrollerExtentHeight, Mode=TwoWay}"
ViewportHeightExt="{Binding MainScrollerViewportHeight, Mode=TwoWay}"
VerticalScrollBarVisibility="Visible"
Background="{Binding BackgroundColor}"
>
<RichTextBox x:Name="MainTextBox" BorderThickness="0" BorderBrush="Transparent" AcceptsTab="True"
CaretBrush="{Binding MainDocumentCaretBrush}" Background="{Binding BackgroundColor}"
FontSize="{Binding Value, ElementName=FontSizeSlider}" Focusable="{Binding Editable, Mode=TwoWay}"
Helpers:RichTextboxAssistant.Document="{Binding MainDocument, Mode=TwoWay}"
Margin="{Binding TextMargin}"
>
</RichTextBox>
</Controls:ScrollViewerExt>
<Controls:EyelineTriangleControl x:Name="EyelineLeftTriangle" Opacity="0.7"
PreviewMouseLeftButtonDown="EyelineLeftTriangle_PreviewMouseLeftButtonDown"
HorizontalAlignment="Left" Height="{Binding EyelineHeight}"
Margin="{Binding LeftEyelineMargin}"
VerticalAlignment="Top" Width="{Binding EyelineWidth}"/>
<Controls:EyelineTriangleControl x:Name="EyelineRightTriangle" Opacity="0.7"
PreviewMouseLeftButtonDown="EyelineLeftTriangle_PreviewMouseLeftButtonDown"
HorizontalAlignment="Right" Height="{Binding EyelineHeight}"
Margin="{Binding RightEyelineMargin}"
VerticalAlignment="Top" Width="{Binding EyelineWidth}" RenderTransformOrigin="0.5,0.5">
<Controls:EyelineTriangleControl.RenderTransform>
<ScaleTransform ScaleX="-1" />
</Controls:EyelineTriangleControl.RenderTransform>
</Controls:EyelineTriangleControl>
</Grid>
</Border>
</Grid>
</Window>