Replies: 5 comments 5 replies
-
|
I suggest using this would be better: https://github.com/AvaloniaUtils/DialogHost.Avalonia/ |
Beta Was this translation helpful? Give feedback.
-
|
The Music Store tutorial does explain it, albeit not in a straightforward way as most things in ReactiveUI are not straightforwards. The simplified tl;dr for it is:
The result is your interaction makes a full round trip from your viewmodel, to your view and back to your view model. If it helps you can think of Interactions as possibly blocking events that allow for data to go two ways (EG from the view model to the view and back). This decouples your view model from your presentation logic, as your view model only cares about the result of the dialogue. Your view model can also just sit there and wait for a result to get back from the interaction. But for most simple dialogues you probably don't want to block. In which case your view would just instantly handle the interaction, show the dialogue and return some default value (likely If you need a more detailed example, let me know. It took me awhile to get my head around it too. I personally would be in favour of the tutorial being expanded upon since it skips/badly explains lot of stuff like this. That said, interactions are not the only way to display dialogues. There are many others. Some follow the MVVM pattern better than others. |
Beta Was this translation helpful? Give feedback.
-
|
I'm using a combination of In the ViewModelBase.cs you can replace
and then call the dialog choosing which DialogWindow to use, eg There are lots of ways of achieving this hence lots of examples. I found these libraries easier to grasp as I've used similar with WPF in the past. I had some recent help from the Prism.Avalonia community on how to implement custom DialogWindow, see this discussion link for more help AvaloniaCommunity/Prism.Avalonia#94 |
Beta Was this translation helpful? Give feedback.
-
|
Sorry to hijack this post, but I feel like I face the same challenge. Not a real programmer, just doing it as a kind hobby and struggling with opening a new view. Sorry for the confusion, but I am confused as he** |
Beta Was this translation helpful? Give feedback.
-
|
Hello everyone. Unfortunately, this is a much larger industry-wide problem that is hindering everyone's progress (everyone who doesn't natively write XAML as a second language, that is). My name is Daniel Patterson, and I am the author of the SvgTools repository at danielanywhere/SvgTools. I have devised a comprehensive method by which people can once again design forms the way they did prior to the disappearance of widget-based form construction, where visual-first, code-second processes worked in a much simpler way that visual people like me could easily relate to. The functionality is still new, so I currently only support Inkscape SVGs and Avalonia output, but the selection of tools will grow as the feature becomes more sophisticated. The method is named Implied Form Design and the basic process is to create a basic SVG image, draw rectangles and other basic shapes, like images, etc., set the Label and ID values of your controls, and then run a special action (ImpliedDesignToAvaloniaXaml) in the command-line SvgTools application to convert that SVG directly to a XAML form compatible with an Avalonia UI desktop application for any target platform. You can see a full description of that process at the front page of the SvgTools repository. The functionality is in an early state. If and when you run into obstacles or other blockages, please create issues so I can get them fixed. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
I've been trying to open viewmodels from usercontrols but I've not any articles or documentation that simplifies the process for a newbie.
I am using MVVM Community Toolkit and most of the implementations are simply too sophisticated. Is there a step-wise procedure or explanation on how to go about understanding this? The Music Store tutorial simply doesn't cut it, as it has little to no explanation on how new windows are handled.
Beta Was this translation helpful? Give feedback.
All reactions