|
<Window x:Class="ColoredWordPad.TextDocument"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:c="clr-namespace:CodeBoxControl;assembly=CodeBoxControl"
Loaded="Window_Loaded"
Closing="Window_Closing"
xmlns:cwp ="clr-namespace:ColoredWordPad"
xmlns:p="clr-namespace:ColoredWordPad.Properties"
xmlns:sw="clr-namespace:System.Windows;assembly=PresentationCore"
xmlns:cd= "clr-namespace:CodeBoxControl.Decorations;assembly=CodeBoxControl"
Title="TextDocument"
Height="{Binding Source={x:Static p:Settings.Default}, Path=Height, Mode=TwoWay}"
Width="{Binding Source={x:Static p:Settings.Default}, Path=Width, Mode=TwoWay}"
Left="{Binding Source={x:Static p:Settings.Default}, Path=Left, Mode=TwoWay}"
Top="{Binding Source={x:Static p:Settings.Default}, Path=Top, Mode=TwoWay}"
>
<Window.Resources>
<cwp:SystemColorConverter x:Key="systemColorConverter"/>
<cwp:ColorBrushConverter x:Key="colorBrushConverter"/>
<c:CodeBoxSettings x:Key="coloredWordSettings"
BaseColor="{Binding Source={x:Static p:Settings.Default}, Path=DefaultBaseForegroungColor, Mode=TwoWay, Converter ={StaticResource colorBrushConverter}}" />
</Window.Resources>
<DockPanel>
<Menu DockPanel.Dock="Top" Name="topMenu"> </Menu>
<ToolBarTray DockPanel.Dock="Top">
<ToolBar>
<Button Click="mnuTest1_Click">Test</Button>
<ComboBox ItemsSource="{Binding Source={x:Static cwp:ToolBarStatics.AvailableSchemes}}" Width="80"
SelectedValue="{Binding ElementName=document, Path=DecorationScheme}"
DisplayMemberPath="Name" Name="cmbScheme" />
<ComboBox x:Name="cbWrap" ItemsSource="{Binding Source={cwp:EnumList {x:Type sw:TextWrapping}}}"
SelectedValue="{Binding ElementName=document, Path=TextWrapping}" />
</ToolBar>
<ToolBar>
<ComboBox Name="cmbColor" Width="150"
SelectedIndex="32"
ItemsSource="{Binding Source={x:Static cwp:SystemNamedBrushes.Colors}}" >
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=.,Converter={StaticResource systemColorConverter}}" Width="110"/>
<Rectangle Width="20" Height="12" Stroke="Black" StrokeThickness="1" Fill="{Binding Path=.,Converter={StaticResource systemColorConverter}}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Button Name="btHilight" Click="btHilight_Click">
<Border Background="Yellow" >
<TextBlock FontWeight="Bold">H</TextBlock>
</Border>
</Button>
<Button Name="btUnderline" Click="btUnderline_Click">
<TextBlock FontWeight="Bold">
<TextBlock.TextDecorations>
<TextDecoration Location="Underline">
<TextDecoration.Pen>
<Pen Brush="Green" Thickness="2" />
</TextDecoration.Pen>
</TextDecoration>
</TextBlock.TextDecorations>U</TextBlock>
</Button>
<Button Name="btStrike" Click="btStrike_Click" >S</Button>
<Button Name="btTextColor" Click="btTextColor_Click">C</Button>
</ToolBar>
</ToolBarTray>
<StatusBar DockPanel.Dock="Bottom" />
<!--<Border Name="documentBorder"
Background="{Binding Source={StaticResource coloredWordSettings}, Path=BackgroundColor,Converter={StaticResource systemColorConverter}}" >-->
<c:CodeBox Name="document"
BaseForeground="{Binding Source={StaticResource coloredWordSettings} , Path=BaseColor, Converter={StaticResource colorBrushConverter}}"
FontSize="{Binding Source={StaticResource coloredWordSettings} , Path=FontSize}"
FontFamily="{Binding Source={StaticResource coloredWordSettings}, Path=FontFamily}"
CodeBoxBackground="{Binding Source={StaticResource coloredWordSettings}, Path=BackgroundColor,Converter={StaticResource systemColorConverter}}" LineNumberMarginWidth="25"
Text="{Binding Source={x:Static p:Settings.Default}, Path=LastText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="Transparent" />
<!--</Border>-->
</DockPanel>
</Window>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Written software for what seems like forever. I'm currenly infatuated with WPF. Hopefully my affections are returned.