Skip to content

Commit 5b3625a

Browse files
committed
pr updates, add readme.md
1 parent dce29da commit 5b3625a

File tree

2 files changed

+229
-0
lines changed

2 files changed

+229
-0
lines changed
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" 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)' == '' ">x86</Platform>
7+
<ProjectGuid>{B27228A6-742A-4813-AA04-95014E620997}</ProjectGuid>
8+
<OutputType>AppContainerExe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>WebView2_UWP</RootNamespace>
11+
<AssemblyName>WebView2_UWP</AssemblyName>
12+
<DefaultLanguage>en-US</DefaultLanguage>
13+
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
14+
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.19041.0</TargetPlatformVersion>
15+
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
16+
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
17+
<FileAlignment>512</FileAlignment>
18+
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
19+
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
20+
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
21+
<PackageCertificateThumbprint>A286F6D6F7643BBBC3FFE24CDF744B16315C29D1</PackageCertificateThumbprint>
22+
<PackageCertificateKeyFile>WebView2_UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
23+
</PropertyGroup>
24+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
25+
<DebugSymbols>true</DebugSymbols>
26+
<OutputPath>bin\x86\Debug\</OutputPath>
27+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
28+
<NoWarn>;2008</NoWarn>
29+
<DebugType>full</DebugType>
30+
<PlatformTarget>x86</PlatformTarget>
31+
<UseVSHostingProcess>false</UseVSHostingProcess>
32+
<ErrorReport>prompt</ErrorReport>
33+
<Prefer32Bit>true</Prefer32Bit>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
36+
<OutputPath>bin\x86\Release\</OutputPath>
37+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
38+
<Optimize>true</Optimize>
39+
<NoWarn>;2008</NoWarn>
40+
<DebugType>pdbonly</DebugType>
41+
<PlatformTarget>x86</PlatformTarget>
42+
<UseVSHostingProcess>false</UseVSHostingProcess>
43+
<ErrorReport>prompt</ErrorReport>
44+
<Prefer32Bit>true</Prefer32Bit>
45+
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
48+
<DebugSymbols>true</DebugSymbols>
49+
<OutputPath>bin\ARM\Debug\</OutputPath>
50+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
51+
<NoWarn>;2008</NoWarn>
52+
<DebugType>full</DebugType>
53+
<PlatformTarget>ARM</PlatformTarget>
54+
<UseVSHostingProcess>false</UseVSHostingProcess>
55+
<ErrorReport>prompt</ErrorReport>
56+
<Prefer32Bit>true</Prefer32Bit>
57+
</PropertyGroup>
58+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
59+
<OutputPath>bin\ARM\Release\</OutputPath>
60+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
61+
<Optimize>true</Optimize>
62+
<NoWarn>;2008</NoWarn>
63+
<DebugType>pdbonly</DebugType>
64+
<PlatformTarget>ARM</PlatformTarget>
65+
<UseVSHostingProcess>false</UseVSHostingProcess>
66+
<ErrorReport>prompt</ErrorReport>
67+
<Prefer32Bit>true</Prefer32Bit>
68+
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
69+
</PropertyGroup>
70+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
71+
<DebugSymbols>true</DebugSymbols>
72+
<OutputPath>bin\ARM64\Debug\</OutputPath>
73+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
74+
<NoWarn>;2008</NoWarn>
75+
<DebugType>full</DebugType>
76+
<PlatformTarget>ARM64</PlatformTarget>
77+
<UseVSHostingProcess>false</UseVSHostingProcess>
78+
<ErrorReport>prompt</ErrorReport>
79+
<Prefer32Bit>true</Prefer32Bit>
80+
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
81+
</PropertyGroup>
82+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
83+
<OutputPath>bin\ARM64\Release\</OutputPath>
84+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
85+
<Optimize>true</Optimize>
86+
<NoWarn>;2008</NoWarn>
87+
<DebugType>pdbonly</DebugType>
88+
<PlatformTarget>ARM64</PlatformTarget>
89+
<UseVSHostingProcess>false</UseVSHostingProcess>
90+
<ErrorReport>prompt</ErrorReport>
91+
<Prefer32Bit>true</Prefer32Bit>
92+
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
93+
</PropertyGroup>
94+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
95+
<DebugSymbols>true</DebugSymbols>
96+
<OutputPath>bin\x64\Debug\</OutputPath>
97+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
98+
<NoWarn>;2008</NoWarn>
99+
<DebugType>full</DebugType>
100+
<PlatformTarget>x64</PlatformTarget>
101+
<UseVSHostingProcess>false</UseVSHostingProcess>
102+
<ErrorReport>prompt</ErrorReport>
103+
<Prefer32Bit>true</Prefer32Bit>
104+
</PropertyGroup>
105+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
106+
<OutputPath>bin\x64\Release\</OutputPath>
107+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
108+
<Optimize>true</Optimize>
109+
<NoWarn>;2008</NoWarn>
110+
<DebugType>pdbonly</DebugType>
111+
<PlatformTarget>x64</PlatformTarget>
112+
<UseVSHostingProcess>false</UseVSHostingProcess>
113+
<ErrorReport>prompt</ErrorReport>
114+
<Prefer32Bit>true</Prefer32Bit>
115+
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
116+
</PropertyGroup>
117+
<PropertyGroup>
118+
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
119+
</PropertyGroup>
120+
<ItemGroup>
121+
<Compile Include="App.xaml.cs">
122+
<DependentUpon>App.xaml</DependentUpon>
123+
</Compile>
124+
<Compile Include="MainPage.xaml.cs">
125+
<DependentUpon>MainPage.xaml</DependentUpon>
126+
</Compile>
127+
<Compile Include="Properties\AssemblyInfo.cs" />
128+
</ItemGroup>
129+
<ItemGroup>
130+
<AppxManifest Include="Package.appxmanifest">
131+
<SubType>Designer</SubType>
132+
</AppxManifest>
133+
</ItemGroup>
134+
<ItemGroup>
135+
<Content Include="Properties\Default.rd.xml" />
136+
<Content Include="Assets\LockScreenLogo.scale-200.png" />
137+
<Content Include="Assets\SplashScreen.scale-200.png" />
138+
<Content Include="Assets\Square150x150Logo.scale-200.png" />
139+
<Content Include="Assets\Square44x44Logo.scale-200.png" />
140+
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
141+
<Content Include="Assets\StoreLogo.png" />
142+
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
143+
</ItemGroup>
144+
<ItemGroup>
145+
<ApplicationDefinition Include="App.xaml">
146+
<Generator>MSBuild:Compile</Generator>
147+
<SubType>Designer</SubType>
148+
</ApplicationDefinition>
149+
<Page Include="MainPage.xaml">
150+
<Generator>MSBuild:Compile</Generator>
151+
<SubType>Designer</SubType>
152+
</Page>
153+
</ItemGroup>
154+
<ItemGroup>
155+
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
156+
<Version>6.2.12</Version>
157+
</PackageReference>
158+
<PackageReference Include="Microsoft.UI.Xaml">
159+
<Version>2.8.0-prerelease.210927001</Version>
160+
</PackageReference>
161+
</ItemGroup>
162+
<ItemGroup>
163+
<None Include="WebView2_UWP_TemporaryKey.pfx" />
164+
</ItemGroup>
165+
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
166+
<VisualStudioVersion>14.0</VisualStudioVersion>
167+
</PropertyGroup>
168+
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
169+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
170+
Other similar extension points exist, see Microsoft.Common.targets.
171+
<Target Name="BeforeBuild">
172+
</Target>
173+
<Target Name="AfterBuild">
174+
</Target>
175+
-->
176+
</Project>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
description: "Demonstrate the features and usage patterns of WebView2 running in a UWP application using winui2."
3+
extendedZipContent:
4+
-
5+
path: SharedContent
6+
target: SharedContent
7+
-
8+
path: LICENSE
9+
target: LICENSE
10+
languages:
11+
- cpp
12+
page_type: sample
13+
products:
14+
- microsoft-edge
15+
urlFragment: WebView2_UWP
16+
---
17+
# WebView2 UWP WinUi2 browser
18+
19+
This is a hybrid application built with the [Microsoft Edge WebView2](https://aka.ms/webview2) control.
20+
21+
![Sample App Snapshot](https://raw.githubusercontent.com/MicrosoftEdge/WebView2Samples/master/SampleApps/WebView2WpfBrowser/screenshots/wpf-browser-screenshot.png)
22+
23+
The WebView2 UWP is an example of an application that embeds a WebView within a UWP application. It is built as a UWP [Visual Studio 2019](https://visualstudio.microsoft.com/vs/) project and makes use of both cpp and HTML/CSS/JavaScript in the WebView2 environment.
24+
25+
The sample showcases simple application structure and handling of webview api.
26+
27+
If this is your first time using WebView, we recommend first following the [Getting Started](https://docs.microsoft.com/microsoft-edge/webview2/gettingstarted/wpf) guide, which goes over how to create a WebView2 and walks through some basic WebView2 functionality.
28+
29+
To learn more specifics about events and API Handlers in WebView2, you can refer to the [WebView2 Reference Documentation](https://docs.microsoft.com/microsoft-edge/webview2/webview2-api-reference).
30+
31+
## Prerequisites
32+
33+
- [Microsoft Edge (Chromium)](https://www.microsoftedgeinsider.com/download/) installed on a supported OS. Currently we recommend the latest version of the Edge Canary channel.
34+
- [Visual Studio](https://visualstudio.microsoft.com/vs/) with .NET support installed.
35+
- Latest pre-release version of our [WebView2 SDK](https://aka.ms/webviewnuget), which is included in this project.
36+
- Latest pre-release version of the [WinUI2 SDK](https://aka.ms/webviewnuget), which is included in this project
37+
38+
## Build the WebView2 UWP WinUi2 browser
39+
40+
Clone the repository and open the solution in Visual Studio. WebView2 & WebUi2 are already included as a NuGet package* in this project.
41+
42+
- Clone this repository
43+
- Open the solution in Visual Studio 2019
44+
- Set the target you want to build (Debug/Release, AnyCPU)
45+
- Build the project file: _WebView2_UWP.csproj_
46+
47+
That's it! Everything should be ready to just launch the app.
48+
49+
*You can get the WebView2 & WinUI2 NugetPackage through the Visual Studio NuGet Package Manager.
50+
51+
## Code of Conduct
52+
53+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [email protected] with any additional questions or comments.

0 commit comments

Comments
 (0)