Skip to content

Commit ac883f3

Browse files
author
Ben Owen
committed
Initial import - working, but quite a crude UX.
1 parent 10719bd commit ac883f3

21 files changed

+1261
-0
lines changed

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "Markdown.XAML"]
2+
path = packages/Markdown.XAML
3+
url = https://github.com/theunrepentantgeek/Markdown.XAML
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5+
</startup>
6+
</configuration>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Application
2+
x:Class="MarkdownEditorDemo.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
</Application.Resources>
8+
</Application>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using System.Windows;
2+
3+
namespace MarkdownEditorDemo {
4+
public partial class App : Application {
5+
}
6+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Window
2+
x:Class="MarkdownEditorDemo.MainWindow"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:editor="clr-namespace:Markdown.Xaml.Editor;assembly=Markdown.Xaml.Editor"
6+
Title="Demo">
7+
8+
<Grid>
9+
<editor:MarkdownEditor
10+
LinkClicked="MarkdownEditor_LinkClicked"
11+
Text="{Binding Text}"/>
12+
</Grid>
13+
</Window>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using Markdown.Xaml.Editor;
2+
using System;
3+
using System.Diagnostics;
4+
using System.IO;
5+
using System.Windows;
6+
7+
namespace MarkdownEditorDemo {
8+
public partial class MainWindow : Window {
9+
public MainWindow() {
10+
InitializeComponent();
11+
DataContext = this;
12+
13+
Text = File.ReadAllText("MainWindow.md");
14+
}
15+
16+
#region Text property
17+
18+
public static readonly DependencyProperty TextProperty =
19+
DependencyProperty.Register(nameof(Text), typeof(String),
20+
typeof(MainWindow), new FrameworkPropertyMetadata());
21+
22+
public string Text {
23+
get { return (string)GetValue(TextProperty); }
24+
set { SetValue(TextProperty, value); }
25+
}
26+
27+
#endregion
28+
29+
private void MarkdownEditor_LinkClicked(object sender, LinkClickedEventArgs e) {
30+
Process.Start(e.Uri);
31+
}
32+
}
33+
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{EAFEED82-234B-4277-A778-A30DAFCAA2C7}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>MarkdownEditorDemo</RootNamespace>
10+
<AssemblyName>MarkdownEditorDemo</AssemblyName>
11+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<WarningLevel>4</WarningLevel>
15+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<PlatformTarget>AnyCPU</PlatformTarget>
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<PlatformTarget>AnyCPU</PlatformTarget>
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\Release\</OutputPath>
32+
<DefineConstants>TRACE</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Reference Include="System" />
38+
<Reference Include="System.Data" />
39+
<Reference Include="System.Xml" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Core" />
42+
<Reference Include="System.Xml.Linq" />
43+
<Reference Include="System.Data.DataSetExtensions" />
44+
<Reference Include="System.Net.Http" />
45+
<Reference Include="System.Xaml">
46+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
47+
</Reference>
48+
<Reference Include="WindowsBase" />
49+
<Reference Include="PresentationCore" />
50+
<Reference Include="PresentationFramework" />
51+
</ItemGroup>
52+
<ItemGroup>
53+
<ApplicationDefinition Include="App.xaml">
54+
<Generator>MSBuild:Compile</Generator>
55+
<SubType>Designer</SubType>
56+
</ApplicationDefinition>
57+
<Page Include="MainWindow.xaml">
58+
<Generator>MSBuild:Compile</Generator>
59+
<SubType>Designer</SubType>
60+
</Page>
61+
<Compile Include="App.xaml.cs">
62+
<DependentUpon>App.xaml</DependentUpon>
63+
<SubType>Code</SubType>
64+
</Compile>
65+
<Compile Include="MainWindow.xaml.cs">
66+
<DependentUpon>MainWindow.xaml</DependentUpon>
67+
<SubType>Code</SubType>
68+
</Compile>
69+
</ItemGroup>
70+
<ItemGroup>
71+
<Compile Include="Properties\AssemblyInfo.cs">
72+
<SubType>Code</SubType>
73+
</Compile>
74+
<Compile Include="Properties\Resources.Designer.cs">
75+
<AutoGen>True</AutoGen>
76+
<DesignTime>True</DesignTime>
77+
<DependentUpon>Resources.resx</DependentUpon>
78+
</Compile>
79+
<Compile Include="Properties\Settings.Designer.cs">
80+
<AutoGen>True</AutoGen>
81+
<DependentUpon>Settings.settings</DependentUpon>
82+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
83+
</Compile>
84+
<EmbeddedResource Include="Properties\Resources.resx">
85+
<Generator>ResXFileCodeGenerator</Generator>
86+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
87+
</EmbeddedResource>
88+
<None Include="..\..\packages\Markdown.XAML\src\Markdown.Xaml.Demo\MainWindow.md">
89+
<Link>MainWindow.md</Link>
90+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
91+
</None>
92+
<None Include="Properties\Settings.settings">
93+
<Generator>SettingsSingleFileGenerator</Generator>
94+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
95+
</None>
96+
</ItemGroup>
97+
<ItemGroup>
98+
<None Include="App.config" />
99+
</ItemGroup>
100+
<ItemGroup>
101+
<ProjectReference Include="..\..\packages\Markdown.XAML\src\Markdown.Xaml\Markdown.Xaml.csproj">
102+
<Project>{34186c3b-c308-4cae-b462-db7b5f5e378c}</Project>
103+
<Name>Markdown.Xaml</Name>
104+
</ProjectReference>
105+
<ProjectReference Include="..\Markdown.Xaml.Editor\Markdown.Xaml.Editor.csproj">
106+
<Project>{09811a0d-2d67-44ca-9476-0a47c9996b2c}</Project>
107+
<Name>Markdown.Xaml.Editor</Name>
108+
</ProjectReference>
109+
</ItemGroup>
110+
<ItemGroup>
111+
<None Include="..\..\packages\Markdown.XAML\src\Markdown.Xaml.Demo\sampleimage.jpg">
112+
<Link>sampleimage.jpg</Link>
113+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
114+
</None>
115+
</ItemGroup>
116+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
117+
</Project>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System.Reflection;
2+
using System.Resources;
3+
using System.Runtime.CompilerServices;
4+
using System.Runtime.InteropServices;
5+
using System.Windows;
6+
7+
// General Information about an assembly is controlled through the following
8+
// set of attributes. Change these attribute values to modify the information
9+
// associated with an assembly.
10+
[assembly: AssemblyTitle("Markdown.Xaml.Editor.Demo")]
11+
[assembly: AssemblyDescription("")]
12+
[assembly: AssemblyConfiguration("")]
13+
[assembly: AssemblyCompany("")]
14+
[assembly: AssemblyProduct("Markdown.Xaml.Editor.Demo")]
15+
[assembly: AssemblyCopyright("Copyright © 2017")]
16+
[assembly: AssemblyTrademark("")]
17+
[assembly: AssemblyCulture("")]
18+
19+
// Setting ComVisible to false makes the types in this assembly not visible
20+
// to COM components. If you need to access a type in this assembly from
21+
// COM, set the ComVisible attribute to true on that type.
22+
[assembly: ComVisible(false)]
23+
24+
//In order to begin building localizable applications, set
25+
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
26+
//inside a <PropertyGroup>. For example, if you are using US english
27+
//in your source files, set the <UICulture> to en-US. Then uncomment
28+
//the NeutralResourceLanguage attribute below. Update the "en-US" in
29+
//the line below to match the UICulture setting in the project file.
30+
31+
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32+
33+
34+
[assembly: ThemeInfo(
35+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36+
//(used if a resource is not found in the page,
37+
// or application resource dictionaries)
38+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39+
//(used if a resource is not found in the page,
40+
// app, or any theme specific resource dictionaries)
41+
)]
42+
43+
44+
// Version information for an assembly consists of the following four values:
45+
//
46+
// Major Version
47+
// Minor Version
48+
// Build Number
49+
// Revision
50+
//
51+
// You can specify all the values or you can default the Build and Revision Numbers
52+
// by using the '*' as shown below:
53+
// [assembly: AssemblyVersion("1.0.*")]
54+
[assembly: AssemblyVersion("1.0.0.0")]
55+
[assembly: AssemblyFileVersion("1.0.0.0")]

src/Markdown.Xaml.Editor.Demo/Properties/Resources.Designer.cs

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)