Split out Controls.Media package. - #3669
Conversation
to Microsoft.Toolkit.Uwp.UI.Controls.Media Issue: coped ControlHelpers.XamlHost.cs Controls -> Controls.Media
|
Thanks RosarioPulella for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
|
@michael-hawker |
|
@RosarioPulella good question. Since it's just a one-line internal helper, I think we could duplicate it in both projects if we'd like vs. trying to move it into the UI package. The other solution is that we just include the original @azchohfi what are your thoughts on this? Is this something we'll still be using in WinUI 3? No, eh as it'll just always be available? |
|
XamlRoot will always be available on WinUI3, so this code can/should be removed on our WinUI3 branch. Right now, on the winui branch, we are copying the winmds to make sure this code works as expected, but this API doesn't make much sense on net5. |
|
Its not being picked up by CI but I am getting issues with the xaml island tests. @azchohfi are those test being run on CI? Are they supposed to run on CI? |
|
I seems that there are no classes in the |
|
@azchohfi @michael-hawker Is b298fd0 a bit better for now? Or just leave it? |
|
@RosarioPulella I used a custom made generator project with lot of hacks to generate them but haven't refined the logic yet. So, leave it as it is. I'll add them post this PR. Is that okay with you @michael-hawker? |
|
Sounds good, thanks @Nirmal4G for taking a look. This should be the last split out, then we just have to bundle what's left into a different named package before we re-create the '.Controls' package as a container for the Primitives, Core, Media, Markdown, and Layout sub-packages under the Controls namespace. After that we can ensure we resolve any loose threads for things we've missed in the Design projects. I know I should add some for the new SwitchPresenter as well. |
| "DrawableList": [ | ||
| { | ||
| "$type": "Microsoft.Toolkit.Uwp.UI.Controls.InkDrawable, Microsoft.Toolkit.Uwp.UI.Controls", | ||
| "$type": "Microsoft.Toolkit.Uwp.UI.Controls.InkDrawable, Microsoft.Toolkit.Uwp.UI.Controls.Media", |
There was a problem hiding this comment.
@azchohfi talking to Rosario, this appears to be the assembly name. So this is going to break compatibility with previously exported InfiniteCanvas files, eh? This is going to be an issue for apps using this control, right?
Any thoughts on how we may be able to mitigate this? This is used directly by System.Text.Json right? Is there some custom Type resolver we could provide to help it do the migration?
There was a problem hiding this comment.
We already have a custom type resolver:
https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/0d43da7ae459d000ee29dcb108cc08a56bf5073f/Microsoft.Toolkit.Uwp.UI.Controls/InfiniteCanvas/JsonConverters/IDrawableConverter.cs#L43-L50
We could either introduce a new version or just try to handle this here. I think it makes more sense to introduce a new version.
There was a problem hiding this comment.
e4db504 Added a check for the old Discriminator.
They are not supposed to be executed on CI. No idea what is going on. |
| [TestMethod] | ||
| public async Task Test_InfiniteCanvas_LoadsV1File() | ||
| [DataRow(@"Assets\Samples\InfiniteCanvasExportPreMedia.json", DisplayName = "Version1")] | ||
| [DataRow(@"Assets\Samples\InfiniteCanvasExport.json", DisplayName = "Version2")] |
There was a problem hiding this comment.
TODO: Should actually generate new file.
|
Currently there are a issues with this branch.
Not sure if they are blockers as this is not going into master yet. |
|
@RosarioPulella I guess the Sample App is still broken due to the Graph Controls? I believe if you just remove the package reference that may be mostly enough? And comment out the thing that adds it to the namespace bucket we use for type loading? Or do we want to leave it broken until we fix the Graph Control problem? Just figured it's be nice to test the stuff that should still be working? Also, shouldn't the animation packaged removed as a dependency now? I'm seeing this on the base 'Controls' package install: Making sure we can run the sample would be handy, as I hit this crash trying to use the @azchohfi thoughts on if we could have the Smoke Test project also run the app somehow like TAEF does? Like just load each one and check that it loaded the main page without crashing? Or should we just beef up our integration tests to have at least basic scenarios for trying to load each control, that may be the better approach, eh? Or both? Note: A future improvement we can make too is to add the Otherwise the Media package on its own is looking good. 👍 |
|
Was just thinking the ColorPicker crash may be an assumption that there's a WinUI 2 resource... FYI @robloo, not sure if you tested without WinUI 2.x resources? |
|
@michael-hawker The ColorPickerButton was added with the assumption that WinUI 2 wasn't available. I didnt realize WCT had a dependency on it - thought you were only updating the target platform to 1809. So yes, it was tested without in August/September last year. That said, when you separated out the Xaml and then added DropDownButton and SwitchPresenter was that after taking a WinUI dependency? I did not review all those Xaml changes. It could have slipped in there. |
I would love to remove it as a dep, but... |
Good to know. We don't have a dependency on WinUI 2.x yet, but we did update to 1809. I don't remember making any style changes with resources. We'll investigate. @RosarioPulella ah, I thought that change to remove ScrollHeader was in the main branch still, it's fixed in the |
|
@michael-hawker I think we have pretty much all the initial features we wanted ready to go now, so yeah I was mostly waiting for some feedbacks at this point, but the PR itself is ready for review. Even if we wanted to add something small later down the line, it'd be just a matter of tweaking a few bits here and there, but I wouldn't expect any major changes at this point. 🙂 |
|
Hello @michael-hawker! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
@michael-hawker The Smoke tests should be as simple as possible. I wouldn't do any complex logic in them at all. In the future we could even parallelize them into different machines. Since it makes sense to have more tests for each control, I would put them in the integration tests. |
michael-hawker
left a comment
There was a problem hiding this comment.
Awesome, took the sample app for a spin, looking good!
|
I'm going to merge this so we can then focus on getting the Animations PR merged and then updating this branch so we can make the final changes all-up? Sound good @RosarioPulella @Sergio0694 @azchohfi? |


Step towards #3594
Split out
Eyedropper,ImageCropper,InfiniteCanvastoMicrosoft.Toolkit.Uwp.UI.Controls.Mediapackage.PR Type
What kind of change does this PR introduce?
What is the current behavior?
Eyedropper,ImageCropper,InfiniteCanvasare inMicrosoft.Toolkit.Uwp.UI.ControlsWhat is the new behavior?
Eyedropper,ImageCropper,InfiniteCanvasare inMicrosoft.Toolkit.Uwp.UI.Controls.MediaPR Checklist
Please check if your PR fulfills the following requirements:
Other information
Issue: copedNot an issueControlHelpers.XamlHost.cs,Controls->Controls.Media