Permalink
Switch branches/tags
Nothing to show
Find file Copy path
6376c7d Mar 30, 2016
2 contributors

Users who have contributed to this file

@theunrepentantgeek @gpailler
53 lines (45 sloc) 2.21 KB
<Window x:Class="Markdown.Demo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Markdown.Xaml;assembly=Markdown.Xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
Title="Markdown.Xaml Demo"
Height="600"
Width="800"
Loaded="Window_Loaded_1">
<Window.Resources>
<local:Markdown x:Key="Markdown"
DocumentStyle="{StaticResource DocumentStyle}"
Heading1Style="{StaticResource H1Style}"
Heading2Style="{StaticResource H2Style}"
Heading3Style="{StaticResource H3Style}"
Heading4Style="{StaticResource H4Style}"
LinkStyle="{StaticResource LinkStyle}"
ImageStyle="{StaticResource ImageStyle}"
SeparatorStyle="{StaticResource SeparatorStyle}"
AssetPathRoot="{x:Static system:Environment.CurrentDirectory}"/>
<local:TextToFlowDocumentConverter x:Key="TextToFlowDocumentConverter"
Markdown="{StaticResource Markdown}"/>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBox x:Name="editSource"
Grid.Row="0"
Grid.Column="0"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
TextWrapping="Wrap"
AcceptsReturn="True"
Margin="5"
VerticalScrollBarVisibility="Auto"/>
<FlowDocumentScrollViewer Grid.Row="0"
Grid.Column="1"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Margin="5"
Document="{Binding ElementName=editSource, Path=Text, Converter={StaticResource TextToFlowDocumentConverter}}" />
</Grid>
</Window>