Skip to content

Commit e0ffccd

Browse files
committed
Fix dependency with prerelease library
Fix network crash for sample app
1 parent 633f2fd commit e0ffccd

File tree

5 files changed

+41
-23
lines changed

5 files changed

+41
-23
lines changed

Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -103,39 +103,46 @@ public async Task<string> GetJavaScriptSourceAsync()
103103

104104
public async Task<string> GetDocumentationAsync()
105105
{
106-
using (var request = new HttpHelperRequest(new Uri(DocumentationUrl), HttpMethod.Get))
106+
try
107107
{
108-
using (var response = await HttpHelper.Instance.SendRequestAsync(request).ConfigureAwait(false))
108+
using (var request = new HttpHelperRequest(new Uri(DocumentationUrl), HttpMethod.Get))
109109
{
110-
if (response.Success)
110+
using (var response = await HttpHelper.Instance.SendRequestAsync(request).ConfigureAwait(false))
111111
{
112-
var result = await response.Content.ReadAsStringAsync();
112+
if (response.Success)
113+
{
114+
var result = await response.Content.ReadAsStringAsync();
113115

114-
// Need to do some cleaning
115-
// Rework code tags
116-
var regex = new Regex("```(xaml|xml|csharp)(?<code>.+?)```", RegexOptions.Singleline);
116+
// Need to do some cleaning
117+
// Rework code tags
118+
var regex = new Regex("```(xaml|xml|csharp)(?<code>.+?)```", RegexOptions.Singleline);
117119

118-
foreach (Match match in regex.Matches(result))
119-
{
120-
var code = match.Groups["code"].Value;
121-
var lines = code.Split('\n');
122-
var newCode = new StringBuilder();
123-
foreach (var line in lines)
120+
foreach (Match match in regex.Matches(result))
124121
{
125-
newCode.AppendLine(" " + line);
122+
var code = match.Groups["code"].Value;
123+
var lines = code.Split('\n');
124+
var newCode = new StringBuilder();
125+
foreach (var line in lines)
126+
{
127+
newCode.AppendLine(" " + line);
128+
}
129+
130+
result = result.Replace(match.Value, newCode.ToString());
126131
}
127132

128-
result = result.Replace(match.Value, newCode.ToString());
129-
}
130-
131-
// Images
132-
regex = new Regex("## Example Image.+?##", RegexOptions.Singleline);
133-
result = regex.Replace(result, "##");
133+
// Images
134+
regex = new Regex("## Example Image.+?##", RegexOptions.Singleline);
135+
result = regex.Replace(result, "##");
134136

135-
return result;
137+
return result;
138+
}
136139
}
137140
}
138141
}
142+
catch (Exception ex)
143+
{
144+
return ex.Message;
145+
}
139146

140147
return string.Empty;
141148
}

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Light/LightBehaviorPage.xaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
Text="Light effects are not available on your version of Windows 10"
1919
TextWrapping="Wrap"
2020
Visibility="Collapsed" />
21+
<TextBlock x:Name="NoCreatorUpdateWarningText"
22+
Margin="0,20"
23+
HorizontalAlignment="Center"
24+
VerticalAlignment="Top"
25+
Foreground="{ThemeResource TextSelectionHighlightColorThemeBrush}"
26+
Text="Warning: This effect has issues on low end devices if you are not on Creator Update or upper"
27+
TextWrapping="Wrap"
28+
Visibility="Collapsed" />
2129

2230
<Image x:Name="ToolkitLogo"
2331
Width="100"

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Light/LightBehaviorPage.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
4343
{
4444
WarningText.Visibility = Visibility.Visible;
4545
}
46+
else
47+
{
48+
NoCreatorUpdateWarningText.Visibility = Visibility.Visible;
49+
}
4650
}
4751
}
4852
}

Microsoft.Toolkit.Uwp.UI.Controls/TileControl/TileControl.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,6 @@ private async Task<bool> LoadImageBrush(Uri uri)
441441
if (strategy == UIStrategy.Composition)
442442
{
443443
var compositor = _containerVisual.Compositor;
444-
445444
var surfaceFactory = SurfaceFactory.GetSharedSurfaceFactoryForCompositor(compositor);
446445

447446
var surfaceUri = await surfaceFactory.CreateUriSurfaceAsync(uri);

build/Microsoft.Toolkit.Uwp.UI.Controls.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<dependency id="Microsoft.Toolkit.Uwp" version="$version$" />
1919
<dependency id="Microsoft.Toolkit.Uwp.UI" version="$version$" />
2020
<dependency id="Microsoft.Toolkit.Uwp.UI.Animations" version="$version$" />
21-
<dependency id="Robmikh.CompositionSurfaceFactory" version="0.7.0-alpha" />
21+
<dependency id="Robmikh.CompositionSurfaceFactory" version="0.7.1" />
2222
</dependencies>
2323
</metadata>
2424
<files>

0 commit comments

Comments
 (0)