Working with XAML in Rider - how to make it usable ?
Hi,
I am currently using Resharper with VS2019 and wanted to give Rider a try. I loaded my project under Rider, a WPF app.
This is what the app looks like when rendered :
Using VS2019, I'm used to Hot reload to make UI changes (works like a charm - despite sometimes needing a restart when changing a dictionary value), and also being able to navigate the component tree to see properties and such. I didn't find such tools in Rider, but at least, unlike VS2019, the WPF preview "works" in Rider.
But the results are disappointing to say the least - it's not usable in its current state, so what am I doing wrong ?
This is the preview of my main window :
I have to force Width and Height manually (and thus, breaking my bindings ! I'm saving those in a settings file) to make it appear normally. d:designwidth and designheight gets ignored.
This is the preview of the "Test schedule" control in my UI above :
Even basic things, such as a row being star sized in a grid, gets rendered incorrectly (the first row is star size, and should get rendered with a height of about 12 pixels, here, it's more like 400 pixels or so) :
I must be missing something here. I can imagine why bindings won't get interpreted, but not using dummy values for text-based bindings, or width/height, is a huge bummer.
So all in all, what am I missing here ? I want to get to the bottom of it before going back to VS2019, as this is a huge showstopper for me unfortunately :(
Please sign in to leave a comment.
Hi Adrien Mercier!
Thank you for the request.
Could you please try to upgrade your Rider to the newest 2021.1.1? We’ve improved our XAML Preview tool for WPF and XAML. Please, let me know if the preview will no become better after the update. I'll kindly ask you to collect your logs in this case. You can do it automatically by creating a new YouTrack issue via `Help | Report a bug`. All logs will be attached privately.
Thank you in advance!
Thanks for notifying me ! Indeed, things are looking MUCH better.
After looping through my controls, I found that the following were not interpreted :
This is creating weird situations when you're binding usercontrol's visibility to the viewmodel for switching components around based on the program's state, but that's entirely unavoidable without design-time data.
The preview is actually working pretty well now, congrats !
I'll give Rider a shot in the next days and see how it goes. Not having the hot reload is probably going to hurt though.
As a side note, I'm baffled that a tool for editing C# like Rider is relying so much on java code (the number of .jar files in rider is important - you've got 427 jar files bundled).
Hi Adrien!
Thank you for the update. Glad to hear it works better now :)
For WPF XAML Hot Reload there is an open issue: RIDER-26302. Please vote and watch.
As to resources that are not resolved, is it still an issue? Could you share with us any samples (code snippet, project or something else) representing it?
Thanks!
Hi,
It is still an issue as the DynamicResource tags aren't properly evaluated in the latest version. StaticResources are, but DynamicResources are not. I'm not sure they're supposed to be ( I would say yes, but I may be hitting an intended limitation here).
I've reproduced it in a small example here :
I'm trying to find where to send you this small example project - uploading a zip file is forbidden here it seems. I'll go through the "report a bug" as you suggested before !
On the left is the running app, with a beautiful background, and on the right is the Rider preview for the very same project.
Hi Adrian!
Thank you for reporting an issue, we'll process it.
Should you have any other questions, let us know!