Reloading WPF XAML while debugging in Rider IDE?
Asked Answered
B

2

9

I am giving the JetBrains Rider IDE a try for Windows development with WPF. (I am on day 1 of my 30 day trial period.)

So, as I am running (debugging) my application, I notice that something is not right on the screen.

I open up the corresponding XAML file from within Rider, I edit it in a way that should result in a big visual difference, but nothing happens on the screen of my application. I save the XAML file from within Rider, still nothing happens on my application. I restart my application, then I see the changes.

With Visual Studio the XAML would be hot-reloaded every time I changed it, so I could see what I was doing without having to restart the application. It was buggy, but still better than nothing.

So:

  1. Does Rider have this feature at all?

  2. Is there some magic trick that enables it?

  3. I noticed that hot-reloading of XAML seems to be supported by Rider in the context of Xamarin, but I am doing WPF, so I assume that's irrelevant for me; is my assumption right?

  4. Is there any solution in DotNet for accomplishing the same thing programmatically? (E.g. I click a button on my app and my app somehow reloads its XAML.)

Bose answered 8/1, 2020 at 17:13 Comment(0)
H
7

For now, Rider does not support any XAML hot reload technologies.

In 2020.x, we are going to ship Xamarin Hot Reload feature. Related request: https://youtrack.jetbrains.com/issue/RIDER-22664

But for WPF, it is much trickier - it is impossible to 'replace' compiled markup on the fly in the running application (Xamarin.Forms does). So we have to build incremental diffs and apply them onto existing visual tree.

This is the most relevant issue for you: https://youtrack.jetbrains.com/issue/RIDER-26302

Helfand answered 8/1, 2020 at 22:14 Comment(6)
Thank you very much for your response. So, this means that item #4 above might be the only option that does not have a definite "No" attached to it already. Do you, or someone else out there, have any advice as to how I could perhaps go about accomplishing item #4 ?Bose
If you want to reload part of your app at runtime, you can try to do something like this: https://mcmap.net/q/346337/-loading-xaml-at-runtimeHelfand
But the task in general is much complicated. I think we will implement it in Rider some time later.Helfand
That's unfortunate! I have a hard time tolerating Visual Studio.Exurbia
Hot Reload seems to be only for Xamarin. Pity :(Imf
Yes, implementing hot reload for desktop WPF apps is another task and much more complicated...Helfand
E
1

As xtmq said Rider does not support any XAML hot reload technologies.

But if you would also appreciate this feature, you may upvote this on YouTrack: https://youtrack.jetbrains.com/issue/RIDER-26302

Enjambment answered 16/4, 2021 at 18:33 Comment(1)
they found a duplicate: youtrack.jetbrains.com/issue/RIDER-26302Enjambment

© 2022 - 2024 — McMap. All rights reserved.