Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 8c1107e

Browse files
hartezJason Smith
authored andcommitted
Enable WebView to render local HTML files on WinRT platforms (#277)
* Enable WebView to render local HTML files on WinRT platforms * Add test to demonstrate that the solution works even if <head> isn't in the HTML string
1 parent b60fa6a commit 8c1107e

File tree

16 files changed

+240
-8
lines changed

16 files changed

+240
-8
lines changed

Xamarin.Forms.ControlGallery.WP8/local.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</head>
55
<body>
66
<h1>Xamarin.Forms</h1>
7-
<p>This is a local iOS Html page</p>
7+
<p>This is a local HTML page</p>
88

99
</body>
1010
</html>
6.83 KB
Loading

Xamarin.Forms.ControlGallery.Windows/Xamarin.Forms.ControlGallery.Windows.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@
189189
<Content Include="Assets\SplashScreen.scale-100.png" />
190190
<Content Include="Assets\StoreLogo.scale-100.png" />
191191
<Content Include="coffee.png" />
192+
<Content Include="default.css" />
193+
<Content Include="local.html" />
192194
<Content Include="toolbar_close.png" />
195+
<Content Include="WebImages\XamarinLogo.png" />
193196
</ItemGroup>
194197
<ItemGroup>
195198
<ApplicationDefinition Include="App.xaml">
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
html,body{margin:0;padding:10}
2+
body,p,h1{font-family:Chalkduster;font-style: italic;}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<html>
2+
<head>
3+
<link rel="stylesheet" href="default.css">
4+
</head>
5+
<body>
6+
<h1>Xamarin.Forms</h1>
7+
<p>This is a local HTML page</p>
8+
9+
</body>
10+
</html>
6.83 KB
Loading

Xamarin.Forms.ControlGallery.WindowsPhone/Xamarin.Forms.ControlGallery.WindowsPhone.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@
166166
<Content Include="Assets\StoreLogo.scale-240.png" />
167167
<Content Include="Assets\WideLogo.scale-240.png" />
168168
<Content Include="coffee.png" />
169+
<Content Include="default.css" />
170+
<Content Include="local.html" />
169171
<Content Include="toolbar_close.png" />
172+
<Content Include="WebImages\XamarinLogo.png" />
170173
</ItemGroup>
171174
<ItemGroup>
172175
<ApplicationDefinition Include="App.xaml">
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
html,body{margin:0;padding:10}
2+
body,p,h1{font-family:Chalkduster;font-style: italic;}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<html>
2+
<head>
3+
<link rel="stylesheet" href="default.css">
4+
</head>
5+
<body>
6+
<h1>Xamarin.Forms</h1>
7+
<p>This is a local HTML page</p>
8+
9+
</body>
10+
</html>
6.83 KB
Loading

0 commit comments

Comments
 (0)