Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demonstration for #33 #34

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<!-- Include PDB in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<IncludePackageReferencesDuringMarkupCompilation>true</IncludePackageReferencesDuringMarkupCompilation>
<AvaloniaVersion>11.0.4</AvaloniaVersion>
<AvaloniaVersion>11.0.5</AvaloniaVersion>
<ReactiveUIVersion>19.5.1</ReactiveUIVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
Expand All @@ -47,7 +47,7 @@
<!--<Compile Update="**\*.cs" DependentUpon="I%(Filename).cs" />-->
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="all" Condition="!Exists('packages.config')" />
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.507" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="4.5.0" PrivateAssets="All" />
<PackageReference Include="Roslynator.Analyzers" Version="4.6.2" PrivateAssets="All" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" />
<PackageReference Include="Nuke.Common" Version="7.0.6" />
<PackageReference Include="CP.Nuke.BuildTools" Version="1.0.32" />
<PackageReference Include="CP.Nuke.BuildTools" Version="1.0.34" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\CrissCross.WPF.WebView2\CrissCross.WPF.WebView2.csproj" />
</ItemGroup>

<ItemGroup>
<Resource Include="*.png" />
</ItemGroup>

</Project>
38 changes: 35 additions & 3 deletions src/CrissCross.WPF.WebView2.Test/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,41 @@
mc:Ignorable="d">
<Grid>
<rxnav:WebView2Wpf x:Name="WebView2Wpf" Source="https://www.aicsolutions.com">
<Grid>
<TextBlock FontSize="20" Text="Hello World" />
</Grid>
<StackPanel HorizontalAlignment="Left">
<TextBlock
x:Name="Greeting"
FontSize="20"
Foreground="Red"
Text="Hello World" />
<Button
Width="100"
Height="100"
Background="Transparent"
Click="ReactiveUI_Click">
<Image Source="/logo.png" />
</Button>
<Button
Width="100"
Height="100"
Background="Transparent"
Click="Windows7_Click">
<Image Source="/logo1.png" />
</Button>
<Button
Width="100"
Height="100"
Background="Transparent"
Click="WindowsXp_Click">
<Image Source="/logo2.png" />
</Button>
<Button
Width="100"
Height="100"
Background="Transparent"
Click="Windows10_Click">
<Image Source="/logo3.png" />
</Button>
</StackPanel>
</rxnav:WebView2Wpf>
</Grid>
</Window>
26 changes: 26 additions & 0 deletions src/CrissCross.WPF.WebView2.Test/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,38 @@ namespace CrissCross.WPF.WebView2.Test
/// </summary>
public partial class MainWindow : Window
{
private int _clickedXTimes = 1;

/// <summary>
/// Initializes a new instance of the <see cref="MainWindow"/> class.
/// </summary>
public MainWindow()
{
InitializeComponent();
}

private void WindowsXp_Click(object sender, RoutedEventArgs e)
{
Greeting.Text = $"Hello CrissCross {_clickedXTimes++}";
WebView2Wpf.Source = new System.Uri("https://support.microsoft.com/en-gb/windows/windows-xp-support-has-ended-47b944b8-f4d3-82f2-9acc-21c79ee6ef5e");
}

private void Windows7_Click(object sender, RoutedEventArgs e)
{
Greeting.Text = $"Hello CrissCross {_clickedXTimes++}";
WebView2Wpf.Source = new System.Uri("https://support.microsoft.com/en-us/windows/windows-7-system-requirements-df0900f2-3513-a851-13e7-0d50bc24e15f");
}

private void Windows10_Click(object sender, RoutedEventArgs e)
{
Greeting.Text = $"Hello CrissCross {_clickedXTimes++}";
WebView2Wpf.Source = new System.Uri("https://www.microsoft.com/en-gb/software-download/windows10");
}

private void ReactiveUI_Click(object sender, RoutedEventArgs e)
{
Greeting.Text = $"Hello CrissCross {_clickedXTimes++}";
WebView2Wpf.Source = new System.Uri("https://www.reactiveui.net/");
}
}
}
Binary file added src/CrissCross.WPF.WebView2.Test/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/CrissCross.WPF.WebView2.Test/logo1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/CrissCross.WPF.WebView2.Test/logo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/CrissCross.WPF.WebView2.Test/logo3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/CrissCross.WPF.WebView2/CrissCross.WPF.WebView2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2065-prerelease" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2194-prerelease" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/CrissCross.WPF/CrissCross.WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="ReactiveUI.WPF" Version="$(ReactiveUIVersion)" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2065-prerelease" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2194-prerelease" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading