Tooling-Windows-Submodule icon indicating copy to clipboard operation
Tooling-Windows-Submodule copied to clipboard

Support for assets in a samples/docs

Open niels9001 opened this issue 3 years ago • 4 comments

Problem Statement

Would be nice to include an Assets folder in the sample project template so you can refer to local images in a sample or doc.

niels9001 avatar Jul 19 '22 13:07 niels9001

We should make sure we can include any type of asset for samples as maybe there's a .json file or something that wants to be used for backing data.

But at least for images at the start, we should make sure they can be referenced in XAML samples (even if it needs the assembly name or something like this):

<Image Source="ms-appx://ProjectTemplateExperiment.Samples/FolderInSamplesProject/MyImageFile.png"/>
<!-- Or ideally short-hand: -->
<Image Source="ms-appx:///FolderInSamplesProject/MyImageFile.png"/>
<Image Source="FolderInSamplesProject/MyImageFile.png"/>

But also easily in the Markdown as well:

![Short Description](FolderInSamplesProject/MyImageFile.png "Longer Description text.")

michael-hawker avatar Jul 19 '22 14:07 michael-hawker

Was needing https://github.com/unoplatform/uno/issues/2502 which should now be in latest uno nightly build.

This should allow us to load rive image and animation for Rive sample in WASM as well as tidy up all our C#/XAML sample file shenanigans.

michael-hawker avatar Nov 10 '22 22:11 michael-hawker

@Arlodotexe we should also be able to just include images as Content or something and reference in a Markdown file:

![Example of foo](images/foo.png)

Don't think this works currently? Not sure where it's looking or what settings I need, will fiddle a bit. Related to CommunityToolkit/Tooling-Windows-Submodule#36

michael-hawker avatar Mar 02 '23 20:03 michael-hawker

May be dependent on just fixing https://github.com/CommunityToolkit/Tooling-Submodule/issues/18?

I can load images I copy over to the head with Content, but not sure how to load them from the Samples assembly...

michael-hawker avatar Mar 02 '23 23:03 michael-hawker