Skip to content

Commit eb1877e

Browse files
committed
Updates per PR review
1 parent b562157 commit eb1877e

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

hub/apps/develop/widgets/implement-widget-provider-cs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ This example will declare some static strings to define the JSON templates for e
8383
Starting with Windows build [TBD - Build number], apps that implement Windows widgets can customize the header that is displayed for their widget in the Widgets Board, overriding the default presentation. For more information, see [Customize the widget header area](widget-header-customization.md).
8484

8585
> [!NOTE]
86-
> Starting with Windows Build [TBD - Build number], apps that implement Windows widgets can choose to populate the widget content with HTML served from a remote URL instead of supplying content in the Adaptive Card schema format in the JSON payload passed from the provider to the Widgets Board. Widget providers must still provide an Adaptive Card JSON payload, so the implementation steps in this walkthrough are applicable to web widgets. For more information, see [Web widget providers](web-widget-providers.md).
86+
> Starting with Windows Build [TBD - Build number], apps that implement Windows widgets can choose to populate the widget content with HTML served from a specified URL instead of supplying content in the Adaptive Card schema format in the JSON payload passed from the provider to the Widgets Board. Widget providers must still provide an Adaptive Card JSON payload, so the implementation steps in this walkthrough are applicable to web widgets. For more information, see [Web widget providers](web-widget-providers.md).
8787
8888
```csharp
8989
// WidgetProvider.cs

hub/apps/develop/widgets/implement-widget-provider-win32.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ This example will declare some static strings to define the JSON templates for e
163163
Starting with Windows build [TBD - Build number], apps that implement Windows widgets can customize the header that is displayed for their widget in the Widgets Board, overriding the default presentation. For more information, see [Customize the widget header area](widget-header-customization.md).
164164
165165
> [!NOTE]
166-
> Starting with Windows Build [TBD - Build number], apps that implement Windows widgets can choose to populate the widget content with HTML served from a remote URL instead of supplying content in the Adaptive Card schema format in the JSON payload passed from the provider to the Widgets Board. Widget providers must still provide an Adaptive Card JSON payload, so the implementation steps in this walkthrough are applicable to web widgets. For more information, see [Web widget providers](web-widget-providers.md).
166+
> Starting with Windows Build [TBD - Build number], apps that implement Windows widgets can choose to populate the widget content with HTML served from a specified URL instead of supplying content in the Adaptive Card schema format in the JSON payload passed from the provider to the Widgets Board. Widget providers must still provide an Adaptive Card JSON payload, so the implementation steps in this walkthrough are applicable to web widgets. For more information, see [Web widget providers](web-widget-providers.md).
167167
168168
```cpp
169169
// WidgetProvider.h

hub/apps/develop/widgets/web-widget-providers.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,21 @@ In the implementation of the **OnResourceRequested** method, widget providers ca
4444
```csharp
4545
async void IWidgetResourceProvider.OnResourceRequested(WidgetResourceRequestedArgs args)
4646
{
47-
var deferral = args.GetDeferral();
48-
49-
Func<Task> asyncLambda = async () =>
47+
if (args.Request.Uri == "Https://contoso.com/logo-image")
5048
{
51-
string fullPath = Windows.ApplicationModel.Package.Current.InstalledPath + "/Assets/image.png";
52-
var file = await StorageFile.GetFileFromPathAsync(fullPath);
53-
var response = new WidgetResourceResponse(RandomAccessStreamReference.CreateFromFile(file), "OK", 200);
54-
};
55-
await asyncLambda();
56-
57-
deferral.Complete();
49+
var deferral = args.GetDeferral();
50+
51+
Func<Task> asyncLambda = async () =>
52+
{
53+
string fullPath = Windows.ApplicationModel.Package.Current.InstalledPath + "/Assets/image.png";
54+
var file = await StorageFile.GetFileFromPathAsync(fullPath);
55+
var response = new WidgetResourceResponse(RandomAccessStreamReference.CreateFromFile(file), "", 200);
56+
args.Response = response;
57+
};
58+
await asyncLambda();
59+
60+
deferral.Complete();
61+
}
5862
}
5963
```
6064

0 commit comments

Comments
 (0)