-
Notifications
You must be signed in to change notification settings - Fork 123
Adding media samples to WCT sample app #639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
michael-hawker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of quick comments, I'll pull this down soon and give them a whirl! Thanks!
|
@erinpwoo also looks like you need to run XAML Styler |
Arlodotexe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building Media.Samples locally, I'm seeing the errors:
1>V:\Windows\components\Media\samples\AcrylicBrush.md(1,1,1,1): error TKSMPL0010: Cannot generate sample page info for file V:\Windows\components\Media\samples\AcrylicBrush.md as an error was encountered parsing its YAML front matter: Can't parse category field, use value from ToolkitSampleCategory enum.
1>V:\Windows\components\Media\samples\BackdropBlurBrush.md(1,1,1,1): error TKSMPL0010: Cannot generate sample page info for file V:\Windows\components\Media\samples\BackdropBlurBrush.md as an error was encountered parsing its YAML front matter: Can't parse category field, use value from ToolkitSampleCategory enum.
1>V:\Windows\components\Media\samples\BackdropGammaTransferBrush.md(1,1,1,1): error TKSMPL0010: Cannot generate sample page info for file V:\Windows\components\Media\samples\BackdropGammaTransferBrush.md as an error was encountered parsing its YAML front matter: Can't parse category field, use value from ToolkitSampleCategory enum.
1>V:\Windows\components\Media\samples\BackdropInvertBrush.md(1,1,1,1): error TKSMPL0010: Cannot generate sample page info for file V:\Windows\components\Media\samples\BackdropInvertBrush.md as an error was encountered parsing its YAML front matter: Can't parse category field, use value from ToolkitSampleCategory enum.
1>V:\Windows\components\Media\samples\BackdropSaturationBrush.md(1,1,1,1): error TKSMPL0010: Cannot generate sample page info for file V:\Windows\components\Media\samples\BackdropSaturationBrush.md as an error was encountered parsing its YAML front matter: Can't parse category field, use value from ToolkitSampleCategory enum.
1>V:\Windows\components\Media\samples\BackdropSepiaBrush.md(1,1,1,1): error TKSMPL0010: Cannot generate sample page info for file V:\Windows\components\Media\samples\BackdropSepiaBrush.md as an error was encountered parsing its YAML front matter: Can't parse category field, use value from ToolkitSampleCategory enum.
1>V:\Windows\components\Media\samples\ImageBlendBrush.md(1,1,1,1): error TKSMPL0010: Cannot generate sample page info for file V:\Windows\components\Media\samples\ImageBlendBrush.md as an error was encountered parsing its YAML front matter: Can't parse category field, use value from ToolkitSampleCategory enum.
1>V:\Windows\components\Media\samples\PipelineBrush.md(1,1,1,1): error TKSMPL0010: Cannot generate sample page info for file V:\Windows\components\Media\samples\PipelineBrush.md as an error was encountered parsing its YAML front matter: Can't parse category field, use value from ToolkitSampleCategory enum.
1>V:\Windows\components\Media\samples\PipelineVisualFactory.md(1,1,1,1): error TKSMPL0010: Cannot generate sample page info for file V:\Windows\components\Media\samples\PipelineVisualFactory.md as an error was encountered parsing its YAML front matter: Can't parse category field, use value from ToolkitSampleCategory enum.
1>V:\Windows\components\Media\samples\TilesBrush.md(1,1,1,1): error TKSMPL0010: Cannot generate sample page info for file V:\Windows\components\Media\samples\TilesBrush.md as an error was encountered parsing its YAML front matter: Can't parse category field, use value from ToolkitSampleCategory enum.
1>C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets(486,5): error MSB4181: The "CompileXaml" task returned false but did not log an error.
1> 13 Warning(s)
1> 11 Error(s)
1>
1>Time Elapsed 00:00:05.25
========== Build: 0 succeeded, 1 failed, 6 up-to-date, 0 skipped ==========
The Category and Subcategory used in the markdown front matter should be sourced from the ToolkitSampleCategory and ToolkitSampleSubcategory enums. The source generator used to discover samples in the gallery parses these categories, and the sample gallery groups them into a tree for the NavigationView pane.
Existing Media samples for EffectAnimations used Animations for the category and Media for the subcategory. For these new samples (visual pipelines, effects and brushes), the Xaml category and the Effects subcategory seem like good options.
@dotnet-policy-service agree |
|
Trying to build locally for Wasdk instead of UWP, I ran into this error: It looks like We'll have to accommodate in our sample-- conditional XAML maybe? @michael-hawker ideas here? |
…to erinwoo/media-samples
|
Our Windows/components/Media/src/Brushes/AcrylicBrush.cs Lines 37 to 70 in c068d2d
We should instead mark this with a warning or deprecation or something if it's WinUI 3 vs. removing it. Then the sample will still compile and work in both places. So, we should probably call this out as a warning block in the docs as well. (e.g. WinUI 3 will always use the Backdrop over HostBackdrop) (This might mean we have a copy of the enum in our namespace for WinUI 3) |
|
The other option is we just have the sample show the regular Backdrop and ignore the host bit for now too. |
|
I think the |
@Arlodotexe I had added the Media ToolkitSampleCategory in addition to the Brushes subcategory. It renders like this in the navigation panel: Do you think it's failing here because of the other xaml failures related to the BackgroundSource property on the Acrylic brush? |
|
Updated AcrylicBrush sample to remove the second example that uses the BackgroundSource property. Instead added a note about the property in a "UWP only" blurb: Addressed the last few comments so the build in WinUI should work now, @Arlodotexe @michael-hawker give it a try and let me know if you have any other feedback. |
|
Got it, I'm able to compile and test now. Seems to work as expected now! @michael-hawker I'm comparing these new docs to our existing Media docs, and noticed that unlike the I think it makes sense to aggregate the Brush-related samples into a single .md doc, like we've done for EffectAnimations in this component. Thoughts? |
|
@Arlodotexe @michael-hawker Just updated to consolidate all the samples into a single Brushes markdown file, still in the same category / subcategory. I left the PipelineBrush and PipelineVisualFactory in their own pages: |
35d6561 to
58990e4
Compare
|
Replacing with #654 without submodule changes. |



Fixes
Added a media section / brush samples to the WCT sample app. These examples serve as a starting point and will be iterated upon to demonstrate how to use and customize attributes of each brush type. Preview of changes:

These samples are based off of the existing WCT docs: https://github.com/MicrosoftDocs/WindowsCommunityToolkitDocs/tree/main/docs/brushes
PR Type
What kind of change does this PR introduce?
What is the current behavior?
No section currently exists for brushes / effects / pipelines.
What is the new behavior?
Added new section for Media and new subsection for Brushes.
PR Checklist
Please check if your PR fulfills the following requirements:
Other information