aboutsummaryrefslogtreecommitdiff
path: root/MarkdownEditor
diff options
context:
space:
mode:
authorathaa <athaa@LAPTOP-TM6J1K6S>2023-03-19 13:03:15 +0700
committerathaa <athaa@LAPTOP-TM6J1K6S>2023-03-19 13:03:15 +0700
commit060455998a74b93eb8ac3b8627d54ca7b9e61146 (patch)
tree4062e3de14b92be835813d8382825fd8138e2ba0 /MarkdownEditor
parentbfaf9b906033ab82ca23593a64d602e9260b75bc (diff)
Add project files.
Diffstat (limited to 'MarkdownEditor')
-rw-r--r--MarkdownEditor/AboutWindow.xaml72
-rw-r--r--MarkdownEditor/AboutWindow.xaml.cs34
-rw-r--r--MarkdownEditor/App.xaml9
-rw-r--r--MarkdownEditor/App.xaml.cs17
-rw-r--r--MarkdownEditor/AssemblyInfo.cs10
-rw-r--r--MarkdownEditor/LICENSE.txt21
-rw-r--r--MarkdownEditor/MainWindow.xaml61
-rw-r--r--MarkdownEditor/MainWindow.xaml.cs295
-rw-r--r--MarkdownEditor/MarkdownEditor.csproj32
-rw-r--r--MarkdownEditor/ResourceDictionary.xaml26
-rw-r--r--MarkdownEditor/app.manifest79
-rw-r--r--MarkdownEditor/icon_markdowneditor.icobin0 -> 67646 bytes
-rw-r--r--MarkdownEditor/icon_markdowneditor.pngbin0 -> 47370 bytes
13 files changed, 656 insertions, 0 deletions
diff --git a/MarkdownEditor/AboutWindow.xaml b/MarkdownEditor/AboutWindow.xaml
new file mode 100644
index 0000000..f7aff6c
--- /dev/null
+++ b/MarkdownEditor/AboutWindow.xaml
@@ -0,0 +1,72 @@
+<Window x:Class="MarkdownEditor.AboutWindow"
+ 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:MarkdownEditor"
+ mc:Ignorable="d"
+ Title="About" Height="400" Width="700"
+ Background="#FF2A2D31" Foreground="White"
+ ResizeMode="NoResize">
+ <Window.Resources>
+ <ResourceDictionary Source="ResourceDictionary.xaml" />
+ </Window.Resources>
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="260"/>
+ <ColumnDefinition />
+ </Grid.ColumnDefinitions>
+
+ <ItemsControl Grid.Column="0">
+ <Image Source="icon_markdowneditor.png" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="30"/>
+ <TextBlock HorizontalAlignment="Center" FontWeight="Bold" FontSize="22">MarkdownEditor</TextBlock>
+ <TextBlock HorizontalAlignment="Center" FontSize="18" Foreground="LightGray">v0.1</TextBlock>
+ <TextBlock HorizontalAlignment="Center" FontSize="16" Foreground="LightGray">
+ <Hyperlink NavigateUri="https://github.com/altaf-creator/MarkdownEditor" Foreground="LightBlue" RequestNavigate="Hyperlink_RequestNavigate">
+ github.com/altaf-creator/<LineBreak />MarkdownEditor
+ </Hyperlink>
+ </TextBlock>
+ </ItemsControl>
+
+ <ItemsControl Grid.Column="1" Margin="10" Background="#FF474850" Padding="10">
+ <ItemsControl.Resources>
+ <Style TargetType="Border">
+ <Setter Property="CornerRadius" Value="5" />
+ </Style>
+ </ItemsControl.Resources>
+ <TextBlock HorizontalAlignment="Center" FontWeight="Bold" FontSize="22">MarkdownEditor</TextBlock>
+ <TextBlock HorizontalAlignment="Left" FontWeight="Bold" Margin="0, 20, 0, 0">Developer</TextBlock>
+ <TextBlock HorizontalAlignment="Left" FontSize="16" Foreground="LightGray">
+ <Hyperlink NavigateUri="https://github.com/altaf-creator" Foreground="LightBlue" RequestNavigate="Hyperlink_RequestNavigate">
+ altaf-creator
+ </Hyperlink>
+ </TextBlock>
+ <TextBlock HorizontalAlignment="Left" FontWeight="Bold" Margin="0, 20, 0,0" >Packages and Software</TextBlock>
+ <TextBlock HorizontalAlignment="Left" FontSize="16" Foreground="LightGray">
+ <Hyperlink NavigateUri="https://github.com/cefsharp/CefSharp" Foreground="LightBlue" RequestNavigate="Hyperlink_RequestNavigate">
+ CefSharp
+ </Hyperlink>
+ - chromium wrapper
+ </TextBlock>
+ <TextBlock FontSize="16" Foreground="LightGray">
+ <Hyperlink NavigateUri="https://github.com/xoofx/markdig" Foreground="LightBlue" RequestNavigate="Hyperlink_RequestNavigate">
+ Markdig
+ </Hyperlink>
+ - markdown parser
+ </TextBlock>
+ <TextBlock FontSize="16" Foreground="LightGray">
+ <Hyperlink NavigateUri="https://github.com/ookii-dialogs/ookii-dialogs-wpf" Foreground="LightBlue" RequestNavigate="Hyperlink_RequestNavigate">
+ Ookii Dialogs
+ </Hyperlink>
+ - open folder dialog
+ </TextBlock>
+ <TextBlock FontSize="16" Foreground="LightGray">Made using .NET C# WPF</TextBlock>
+ </ItemsControl>
+
+ <TextBlock FontSize="16" Foreground="LightGray" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="20" Grid.Column="1">
+ <Hyperlink NavigateUri="https://mit-license.org/" Foreground="LightBlue" RequestNavigate="Hyperlink_RequestNavigate">
+ View License
+ </Hyperlink>
+ </TextBlock>
+ </Grid>
+</Window>
diff --git a/MarkdownEditor/AboutWindow.xaml.cs b/MarkdownEditor/AboutWindow.xaml.cs
new file mode 100644
index 0000000..0c1bf24
--- /dev/null
+++ b/MarkdownEditor/AboutWindow.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace MarkdownEditor
+{
+ /// <summary>
+ /// Interaction logic for AboutWindow.xaml
+ /// </summary>
+ public partial class AboutWindow : Window
+ {
+ public AboutWindow()
+ {
+ InitializeComponent();
+ }
+
+ private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
+ {
+ Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
+ e.Handled = true;
+ }
+ }
+}
diff --git a/MarkdownEditor/App.xaml b/MarkdownEditor/App.xaml
new file mode 100644
index 0000000..33a6502
--- /dev/null
+++ b/MarkdownEditor/App.xaml
@@ -0,0 +1,9 @@
+<Application x:Class="MarkdownEditor.App"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="clr-namespace:MarkdownEditor"
+ StartupUri="MainWindow.xaml">
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/MarkdownEditor/App.xaml.cs b/MarkdownEditor/App.xaml.cs
new file mode 100644
index 0000000..88a53f2
--- /dev/null
+++ b/MarkdownEditor/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace MarkdownEditor
+{
+ /// <summary>
+ /// Interaction logic for App.xaml
+ /// </summary>
+ public partial class App : Application
+ {
+ }
+}
diff --git a/MarkdownEditor/AssemblyInfo.cs b/MarkdownEditor/AssemblyInfo.cs
new file mode 100644
index 0000000..8b5504e
--- /dev/null
+++ b/MarkdownEditor/AssemblyInfo.cs
@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
diff --git a/MarkdownEditor/LICENSE.txt b/MarkdownEditor/LICENSE.txt
new file mode 100644
index 0000000..4d4e53a
--- /dev/null
+++ b/MarkdownEditor/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Athaalaa Altaf Hafidz
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE. \ No newline at end of file
diff --git a/MarkdownEditor/MainWindow.xaml b/MarkdownEditor/MainWindow.xaml
new file mode 100644
index 0000000..f15d489
--- /dev/null
+++ b/MarkdownEditor/MainWindow.xaml
@@ -0,0 +1,61 @@
+<Window x:Class="MarkdownEditor.MainWindow"
+ 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:MarkdownEditor"
+ xmlns:cef="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
+ mc:Ignorable="d"
+ Title="MarkdownEditor - a basic markdown viewer and editor" Height="720" Width="1280" Background="#FF2A2D31"
+ Closing="Window_Closing" Icon="/icon_markdowneditor.png" Foreground="White">
+ <Window.Resources>
+ <ResourceDictionary Source="ResourceDictionary.xaml" />
+ </Window.Resources>
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="38"/>
+ <RowDefinition />
+ </Grid.RowDefinitions>
+
+ <Button Name="saveBtn" Margin="10,10,0,0" Width="28" Click="saveBtn_Click" Padding="0" ToolTip="Save">💾</Button>
+ <Button Name="saveAsBtn" Margin="43,10,0,0" Width="28" Padding="0" ToolTip="Save As" Click="saveAsBtn_Click">
+ <Button.Foreground>
+ <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.ActiveCaptionColorKey}}"/>
+ </Button.Foreground> 💾
+ </Button>
+ <Button Name="exportBtn" Margin="76,10,0,0" Width="28" Click="exportBtn_Click" FontSize="15" Padding="0" ToolTip="Export to HTML">📤</Button>
+ <Button Name="openBtn" Margin="109,10,0,0" Width="28" Click="openBtn_Click" Padding="0" ToolTip="Open File">📂</Button>
+ <Button Name="openFolderBtn" Margin="142,10,0,0" Width="28" Padding="0" ToolTip="Open Folder" Click="openFolderBtn_Click">🗃️</Button>
+ <Button Name="aboutBtn" Margin="0,10,10,0" Width="28" Padding="0" ToolTip="About" HorizontalAlignment="Right" FontSize="18" FontWeight="Bold" Click="aboutBtn_Click">i</Button>
+
+ <Grid Grid.Row="1" Grid.ColumnSpan="2">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="300"/>
+ <ColumnDefinition />
+ <ColumnDefinition />
+ </Grid.ColumnDefinitions>
+
+ <ScrollViewer Margin="10, 32, 5, 47" VerticalScrollBarVisibility="Auto">
+ <ItemsControl Name="filePanel" Background="#FF474850" Grid.Column="0" Padding="10" BorderThickness="0">
+ <ItemsControl.Resources>
+ <Style TargetType="Border">
+ <Setter Property="CornerRadius" Value="5" />
+ </Style>
+ </ItemsControl.Resources>
+ </ItemsControl>
+ </ScrollViewer>
+ <TextBlock HorizontalAlignment="Center" VerticalAlignment="Top" Grid.Column="0" FontWeight="Bold" Margin="10,5,10,10">Opened Files</TextBlock>
+ <Button Name="clearBtn" Width="285" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="10, 5, 5, 10" Click="clearBtn_Click">Clear Items</Button>
+
+ <TextBlock Name="pathTxt" HorizontalAlignment="Center" VerticalAlignment="Top" Grid.Column="1" FontWeight="Bold" Margin="10,5,10,10">C:\path\to\file</TextBlock>
+ <TextBox Name="txtRaw" AcceptsTab="True" AcceptsReturn="True" Margin="5, 32, 5, 10" Padding="10" FontFamily="Consolas" FontSize="16" Background="#FF474850" Foreground="White" BorderThickness="0" Grid.Column="1" TextWrapping="Wrap">
+ <TextBox.Resources>
+ <Style TargetType="Border">
+ <Setter Property="CornerRadius" Value="5"/>
+ </Style>
+ </TextBox.Resources>
+ </TextBox>
+ <cef:ChromiumWebBrowser Name="browser" Margin="10, 5, 10, 10" Grid.Column="2" />
+ </Grid>
+ </Grid>
+</Window>
diff --git a/MarkdownEditor/MainWindow.xaml.cs b/MarkdownEditor/MainWindow.xaml.cs
new file mode 100644
index 0000000..68c90f2
--- /dev/null
+++ b/MarkdownEditor/MainWindow.xaml.cs
@@ -0,0 +1,295 @@
+using System;
+using System.Collections.Generic;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Threading;
+using System.Diagnostics;
+using Microsoft.Win32;
+using System.IO;
+using CefSharp;
+using Markdig;
+using Path = System.IO.Path;
+using Ookii.Dialogs.Wpf;
+using System.ComponentModel;
+using System.Drawing;
+
+namespace MarkdownEditor
+{
+ /// <summary>
+ /// Interaction logic for MainWindow.xaml
+ /// </summary>
+ public partial class MainWindow : Window
+ {
+ public string path;
+ public string rootPath;
+ public string tempPath = Path.GetTempPath() + "markdowneditor_temp.html";
+ private string prevTxt;
+ public bool isOpened = false;
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ prevTxt = txtRaw.Text;
+ rootPath = "";
+ path = "";
+
+ System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
+ dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
+ dispatcherTimer.Interval = TimeSpan.FromSeconds(.5f);
+ dispatcherTimer.Start();
+ File.WriteAllText(tempPath, "");
+ browser.Load(tempPath);
+ }
+
+ private void dispatcherTimer_Tick(object sender, EventArgs e)
+ {
+ if (prevTxt != txtRaw.Text)
+ {
+ var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
+ string font = "<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\r\n<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\r\n<link href=\"https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;700&display=swap\" rel=\"stylesheet\">";
+ // CSS styling. Please forgive me.
+ string style = @"<style>
+ body {
+ font-family: 'Roboto Slab', serif;
+ background-color: #2a2d31;
+ border-radius: 5px;
+ color: #FFFFFF;
+ }
+ a {
+ color: #b4ccfe;
+ }
+ a:hover {
+ color: #869fd5;
+ }
+ a:focus {
+ color: #4978df;
+ }
+ img {
+ max-width: 100%;
+ border-radius: 5px;
+ }
+ blockquote {
+ margin: 20px 0 30px;
+ padding-left: 20px;
+ border-left: 3px solid #FFFFFF
+ }
+ pre {
+ padding: 5px;
+ background-color: #474850;
+ border-radius: 5px;
+ overflow: scroll;
+ overflow-y: auto;
+ overflow-x: auto;
+ }
+ p > code {
+ padding: 5px;
+ background-color: #474850;
+ border-radius: 5px;
+ }
+ p {
+ word-break: normal;
+ white-space: normal;
+ }
+ td, th {
+ border: 1px solid #474850;
+ padding: 8px;
+ margin: 0;
+ }
+ th {
+ padding-top: 10px;
+ padding-bottom: 10px;
+ text-align: center;
+ background-color: #474850;
+ }
+ table {
+ border-collapse: collapse;
+ }
+ ::-webkit-scrollbar {
+ width: 10px;
+ }
+ ::-webkit-scrollbar-track {
+ background: #00000000;
+ }
+ ::-webkit-scrollbar-thumb {
+ border-radius: 5px;
+ background: #b1b1b18f;
+ }
+ ::-webkit-scrollbar-thumb:hover {
+ background: #b1b1b1b6;
+ }
+ ::-webkit-scrollbar-thumb:active {
+ background: #b1b1b152;
+ }
+ h1 {
+ border-bottom: solid white 1px;
+ padding-bottom: 0.8rem;
+ }
+ </style>";
+ var result = Markdown.ToHtml(txtRaw.Text, pipeline);
+
+ File.WriteAllText(tempPath, font + style + result);
+
+ string htmlPath = "file:///" + tempPath;
+
+ if (browser.Address != htmlPath.Replace('\\','/'))
+ {
+ browser.Load(tempPath);
+ }
+ else
+ {
+ browser.Reload();
+ }
+ prevTxt = txtRaw.Text;
+ }
+
+ string formattedPath = path;
+
+ pathTxt.Text = formattedPath.Substring(rootPath.Length);
+ browser.LoadError += browser_LoadError;
+ }
+
+ private void saveBtn_Click(object sender, RoutedEventArgs e)
+ {
+ string text = txtRaw.Text;
+
+ if (!isOpened)
+ {
+ SaveFileDialog saveFileDialog = new SaveFileDialog();
+ saveFileDialog.Filter = "Markdown (*.md)|*.md|Text (*.txt)|*.txt|All (*.*)|*.*";
+
+ if (saveFileDialog.ShowDialog() == true)
+ {
+ path = saveFileDialog.FileName;
+ File.WriteAllText(path, text);
+ isOpened = true;
+ }
+ }
+ else
+ {
+ File.WriteAllText(path, text);
+ }
+ }
+
+ private void openBtn_Click(object sender, RoutedEventArgs e)
+ {
+ OpenFileDialog openFileDialog = new OpenFileDialog();
+ openFileDialog.Filter = "Markdown Files (*.md)|*.md|Text Files (*.txt)|*.txt|All (*.*)|*.*";
+
+ if (openFileDialog.ShowDialog() == true)
+ {
+ path = openFileDialog.FileName;
+ rootPath = "";
+ txtRaw.Text = File.ReadAllText(path);
+
+ var fileButton = new Button();
+ fileButton.Content = Path.GetFileName(path);
+ fileButton.ToolTip = path;
+ fileButton.Click += fileBtn_Click;
+ filePanel.Items.Insert(0, fileButton);
+
+ isOpened = true;
+ }
+ }
+
+ private void exportBtn_Click(object sender, RoutedEventArgs e)
+ {
+ string text = Markdig.Markdown.ToHtml(txtRaw.Text);
+ SaveFileDialog saveFileDialog = new SaveFileDialog();
+ saveFileDialog.Filter = "HTML (*.html)|*.html|Text (*.txt)|*.txt|All (*.*)|*.*";
+
+ if (saveFileDialog.ShowDialog() == true)
+ {
+ path = saveFileDialog.FileName;
+ File.WriteAllText(path, text);
+ }
+ }
+
+ private void fileBtn_Click(object sender, RoutedEventArgs e)
+ {
+
+ var element = (FrameworkElement)sender;
+ string tooltip = element.ToolTip.ToString();
+
+ txtRaw.Text = File.ReadAllText(tooltip);
+ path = tooltip;
+ isOpened = true;
+ }
+
+ private void clearBtn_Click(object sender, RoutedEventArgs e)
+ {
+ filePanel.Items.Clear();
+ }
+
+ private void openFolderBtn_Click(object sender, RoutedEventArgs e)
+ {
+ var dialog = new VistaFolderBrowserDialog();
+ dialog.Description = "Select Folder";
+ dialog.UseDescriptionForTitle = true;
+
+ if (dialog.ShowDialog() == true)
+ {
+ path = dialog.SelectedPath;
+ rootPath = dialog.SelectedPath;
+
+ string[] files = Directory.GetFiles(path, "*.md", SearchOption.AllDirectories);
+
+ filePanel.Items.Clear();
+
+ for (int i = files.Length - 1; i >= 0; i--)
+ {
+ var fileButton = new Button();
+ string str = files[i];
+
+ str = str.Substring(path.Length);
+
+ fileButton.Content = str;
+ fileButton.ToolTip = files[i];
+ fileButton.Click += fileBtn_Click;
+ filePanel.Items.Insert(0, fileButton);
+ }
+ }
+ }
+
+ private void saveAsBtn_Click(object sender, RoutedEventArgs e)
+ {
+ string text = txtRaw.Text;
+ SaveFileDialog saveFileDialog = new SaveFileDialog();
+ saveFileDialog.Filter = "Markdown (*.md)|*.md|Text (*.txt)|*.txt|All (*.*)|*.*";
+
+ if (saveFileDialog.ShowDialog() == true)
+ {
+ path = saveFileDialog.FileName;
+ File.WriteAllText(path, text);
+ }
+
+ }
+
+ private void Window_Closing(object sender, CancelEventArgs e)
+ {
+ File.Delete(tempPath);
+ }
+
+ public void browser_LoadError(object sender, EventArgs e)
+ {
+ browser.Load(tempPath);
+ }
+
+ private void aboutBtn_Click(object sender, RoutedEventArgs e)
+ {
+ Window window = new AboutWindow();
+ window.Show();
+ }
+ }
+}
diff --git a/MarkdownEditor/MarkdownEditor.csproj b/MarkdownEditor/MarkdownEditor.csproj
new file mode 100644
index 0000000..f1a6435
--- /dev/null
+++ b/MarkdownEditor/MarkdownEditor.csproj
@@ -0,0 +1,32 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>WinExe</OutputType>
+ <TargetFramework>net48</TargetFramework>
+ <Nullable>enable</Nullable>
+ <UseWPF>true</UseWPF>
+ <Platforms>AnyCPU;x64</Platforms>
+ <ApplicationManifest>app.manifest</ApplicationManifest>
+ <LangVersion>8.0</LangVersion>
+ <ApplicationIcon>icon_markdowneditor.ico</ApplicationIcon>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <None Remove="icon_markdowneditor.png" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Content Include="icon_markdowneditor.ico" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <PackageReference Include="CefSharp.Wpf" Version="111.2.20" />
+ <PackageReference Include="Markdig" Version="0.31.0" />
+ <PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Resource Include="icon_markdowneditor.png" />
+ </ItemGroup>
+
+</Project>
diff --git a/MarkdownEditor/ResourceDictionary.xaml b/MarkdownEditor/ResourceDictionary.xaml
new file mode 100644
index 0000000..fb2e442
--- /dev/null
+++ b/MarkdownEditor/ResourceDictionary.xaml
@@ -0,0 +1,26 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+ <Style TargetType="Button">
+ <Setter Property="Background" Value="#FF474850" />
+ <Setter Property="Foreground" Value="White" />
+ <Setter Property="FontFamily" Value="Consolas" />
+ <Setter Property="HorizontalAlignment" Value="Left" />
+ <Setter Property="Margin" Value="5" />
+ <Setter Property="Padding" Value="5" />
+ <Style.Resources>
+ <Style TargetType="Border">
+ <Setter Property="CornerRadius" Value="5" />
+ </Style>
+ </Style.Resources>
+ </Style>
+
+ <Style TargetType="TextBlock">
+ <Setter Property="FontFamily" Value="Consolas" />
+ <Setter Property="FontSize" Value="18" />
+ <Setter Property="Foreground" Value="White" />
+ </Style>
+
+
+</ResourceDictionary>
+
+ \ No newline at end of file
diff --git a/MarkdownEditor/app.manifest b/MarkdownEditor/app.manifest
new file mode 100644
index 0000000..fa8f332
--- /dev/null
+++ b/MarkdownEditor/app.manifest
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+ <assemblyIdentity version="1.0.0.0" name="MarkdownEditor.app"/>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+ <security>
+ <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+ <!-- UAC Manifest Options
+ If you want to change the Windows User Account Control level replace the
+ requestedExecutionLevel node with one of the following.
+
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <requestedExecutionLevel level="highestAvailable" uiAccess="false" />
+
+ Specifying requestedExecutionLevel element will disable file and registry virtualization.
+ Remove this element if your application requires this virtualization for backwards
+ compatibility.
+ -->
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!-- A list of the Windows versions that this application has been tested on
+ and is designed to work with. Uncomment the appropriate elements
+ and Windows will automatically select the most compatible environment. -->
+
+ <!-- Windows Vista -->
+ <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
+
+ <!-- Windows 7 -->
+ <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
+
+ <!-- Windows 8 -->
+ <!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
+
+ <!-- Windows 8.1 -->
+ <!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
+
+ <!-- Windows 10 -->
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
+
+ </application>
+ </compatibility>
+
+ <!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
+ DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
+ to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
+ also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config.
+
+ Makes the application long-path aware. See https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
+ <!--
+ <application xmlns="urn:schemas-microsoft-com:asm.v3">
+ <windowsSettings>
+ <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
+ <longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
+ </windowsSettings>
+ </application>
+ -->
+
+ <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
+ <!--
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="*"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+ </dependency>
+ -->
+
+</assembly>
diff --git a/MarkdownEditor/icon_markdowneditor.ico b/MarkdownEditor/icon_markdowneditor.ico
new file mode 100644
index 0000000..65b39b9
--- /dev/null
+++ b/MarkdownEditor/icon_markdowneditor.ico
Binary files differ
diff --git a/MarkdownEditor/icon_markdowneditor.png b/MarkdownEditor/icon_markdowneditor.png
new file mode 100644
index 0000000..40d0d9d
--- /dev/null
+++ b/MarkdownEditor/icon_markdowneditor.png
Binary files differ