Page 1 of 2
Interest in WPF/MVVM Framework in X#
Posted: Sat Oct 14, 2023 5:12 am
by wriedmann
Hi all,
as asked in my GUI Choices session in Memmingen: is there is any interest in the X# Community for a WPF/MVVM Framework together with a sample application?
If so, please let me know here in this forum.
If there is any interest, I will build one based on my own framework and in the XSharp.Tools.WPF namespace to be used for everyone, and if the X# Summit Organization Team permits, present and introduce it in the next edition of the X# Summit in 2024.
Together with this Toolkit there should be a sample application like the SSA (South Seas Adventure) in VO.
Wolfgang
P.S. this could be the 4th real X# exclusive GUI after the VOGUI, the XGUI and the XVFP classes
Re: Interest in WPF/MVVM Framework in X#
Posted: Sat Oct 14, 2023 8:22 am
by lumberjack
No objections this side Wolfgang.
Johan
Re: Interest in WPF/MVVM Framework in X#
Posted: Mon Oct 16, 2023 4:23 pm
by AlessandroV
I think can be very interesting for me.
Alessandro
Re: Interest in WPF/MVVM Framework in X#
Posted: Tue Oct 17, 2023 8:42 am
by ic2
I have a couple of WPF projects, but all within a C# project. That doesn't change the WPF of course. For example, I have a nice WPF toaster window, which can show a message in the lower right corner which fades away after a given time. Maybe it can be added to a WPF SSA sample.
Re: Interest in WPF/MVVM Framework in X#
Posted: Tue Oct 17, 2023 1:17 pm
by Luc
Hi wolfgang,
I'm also very interested in the wpf/mvvm framework you showed in Memmingen, as it looks a nice piece of work that makes it easy to setup the controls this way.
thanks,
Luc
Re: Interest in WPF/MVVM Framework in X#
Posted: Tue Oct 17, 2023 2:02 pm
by FFF
Wolfgang,
here too. Especially, if the "databinding" part is included and SIMPLE for noobs like me
Re: Interest in WPF/MVVM Framework in X#
Posted: Tue Oct 17, 2023 3:34 pm
by wriedmann
Hi Karl,
WPF without databinding looses most of its power, and MVVM without databinding is not MVVM.
So you can count on this.
Wolfgang
Re: Interest in WPF/MVVM Framework in X#
Posted: Sun Oct 22, 2023 7:54 pm
by ic2
Hello Wolfgang,
wriedmann wrote: ↑Tue Oct 17, 2023 3:34 pm
WPF without databinding looses most of its power, and MVVM without databinding is not MVVM.
I disagree with you on that. Most of the times I used databinding, something was not updated while it should for whatever reason and it is then impossible to use debugging to find out why not. So I avoid databinding wherever possible; I think for me it has only been only really useful twice. Other cons are that a compiler warns if you try to update a control which isn't there but with databinding your update may not reach your UI without the compiler seeing that. Plus you have a lot more code in which you can not clearly follow which part of your screen is updated after a certain action. I prefer a clear 'if some condition - MyControl:Text="something". Finally it doesn't fix the issue that a screen may not be updated when a loop is busy either.
There are other advantages to use WPF above Winforms: WPF offers you more flexibility to adapt the layout of a screen, you can often find some XML code on line which you can directly paste in your own XML and then you have e.g. a custom control with little effort (except some searching) and another reason I used it recently was the Syncfusion PDF control where the WPF version had more options than the Winforms one.
Drawback is that it is often not easy to drag controls to a certain position for some reason which often does not make sense, like that you have to wrap controls within a stackpanel or a grid or some other panel. Also one incorrect tag into you XAML and the whole preview disappears until you find what is wrong, which is also not obvious most of the times.
Dick
Re: Interest in WPF/MVVM Framework in X#
Posted: Mon Oct 23, 2023 3:36 am
by wriedmann
Hi Dick,
I know that you disagree <g>.
My points about WPF are mainly two: the flexibility to build an interface, and the very powerful databinding.
IMHO in WPF it makes absolutely no sense to "design" a window in a window editor, you need to use panels and to structure your user interface so it can adapt to your needs.
And the databinding has to be thinked much larger than only about data: properties like colors, readonly and fonts can be bound to your data since they largely depend on your data.
And what I do all the time is what we learned from VO: build your own control classes that help you a lot saving code and giving you more control of your written code.
Wolfgang
Re: Interest in WPF/MVVM Framework in X#
Posted: Mon Oct 23, 2023 7:38 pm
by ic2
Hello Wolfgang,
To clarify myself a bit more: I do not at all mean that your approach is not good. If you get it actually working, which is quite an achievement
databinding could serve you well.
What I just wanted it to add is that there can be other major advantages to choosing WPF above Winforms, even if you don't use databinding.
I also admit that using the window editor is not the easiest task in WPF, but it's there and it
does make sense to use it (at least partly), e.g. when you add a couple of controls you may type in their positions in the XAML, guessing where they will end up in the window, or you may drag that control to the position where you want it, and unless it get lost a bit because it did not end up in the right panel, you have the correct XAML line without 'trial and error'.
Dick