Skip to content

Commit

Permalink
Merge pull request #1 from michaldivis/v0.1.1-alpha
Browse files Browse the repository at this point in the history
V0.1.1 alpha
  • Loading branch information
michaldivis committed May 12, 2021
2 parents 1fd33e2 + 21531a2 commit b0b2ff3
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
6 changes: 3 additions & 3 deletions DarkHtmlViewer.sln
Expand Up @@ -3,18 +3,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31129.286
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DarkHtmlViewer", "src\DarkHtmlViewer\DarkHtmlViewer.csproj", "{992F6AC0-6571-4BE2-8055-90A5604F6FFC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkHtmlViewer", "src\DarkHtmlViewer\DarkHtmlViewer.csproj", "{992F6AC0-6571-4BE2-8055-90A5604F6FFC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B3EA3A97-B058-466C-AD9C-652395957DE0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{F889AF35-BE64-4FE8-B805-FBB0C836A4BF}"
ProjectSection(SolutionItems) = preProject
docs\README.md = docs\README.md
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demos", "demos", "{C6CD08FE-7ADD-4802-BF67-FF5D177D9017}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DarkHtmlViewerBasicDemo", "demos\DarkHtmlViewerBasicDemo\DarkHtmlViewerBasicDemo.csproj", "{8831F5C0-B810-4F6E-8EF3-C4AB048BA9F4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkHtmlViewerBasicDemo", "demos\DarkHtmlViewerBasicDemo\DarkHtmlViewerBasicDemo.csproj", "{8831F5C0-B810-4F6E-8EF3-C4AB048BA9F4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 4 additions & 0 deletions README.md
@@ -0,0 +1,4 @@
# Dark HTML Viewer

## Nuget
[![Nuget](https://img.shields.io/nuget/v/divis.darkhtmlviewer?label=Divis.DarkHtmlViewer)](https://www.nuget.org/packages/Divis.DarkHtmlViewer/)
5 changes: 5 additions & 0 deletions demos/DarkHtmlViewerBasicDemo/DemoView.xaml
Expand Up @@ -44,6 +44,11 @@
Command="{Binding ElementName=darkHtmlViewer, Path=ScrollCommand}"
CommandParameter="footer"
Content="Scroll to footer" />
<Button
Margin="5"
Padding="10,5,10,5"
Command="{Binding ElementName=darkHtmlViewer, Path=PrintCommand}"
Content="Print" />
</WrapPanel>
</Border>

Expand Down
Empty file removed docs/readme.md
Empty file.
3 changes: 2 additions & 1 deletion src/DarkHtmlViewer/DarkHtmlViewer.csproj
Expand Up @@ -3,14 +3,15 @@
<PropertyGroup>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<Version>0.1.0-alpha</Version>
<Version>0.1.1-alpha</Version>
<Authors>Michal Diviš</Authors>
<Description>A simple HTML viewer control for WPF (using WebView2)</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/michaldivis/DarkHtmlViewer</PackageProjectUrl>
<RepositoryUrl>https://github.com/michaldivis/DarkHtmlViewer</RepositoryUrl>
<PackageIcon>icon.png</PackageIcon>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>Divis.DarkHtmlViewer</PackageId>
</PropertyGroup>

<ItemGroup>
Expand Down
11 changes: 11 additions & 0 deletions src/DarkHtmlViewer/DarkHtmlViewer.xaml.cs
Expand Up @@ -49,6 +49,7 @@ public ICommand LinkClickedCommand
public ICommand LoadCommand => new DarkCommand<string>(LoadHtmlContent);
public ICommand ScrollCommand => new DarkAsyncCommand<string>(ScrollAsync);
public ICommand LoadAndScrollCommand => new DarkAsyncCommand<LoadAndScrollData>(LoadAndScrollAsync);
public ICommand PrintCommand => new DarkAsyncCommand(PrintAsync);

#endregion

Expand Down Expand Up @@ -145,6 +146,16 @@ private async Task LoadAndScrollAsync(LoadAndScrollData data)

#endregion

#region Printing

private async Task PrintAsync()
{
var script = "window.print();";
await webView2.ExecuteScriptAsync(script);
}

#endregion

#region Browser settings

private void DisableAllExtraFunctionality()
Expand Down

0 comments on commit b0b2ff3

Please sign in to comment.