Interest in WPF/MVVM Framework in X#

This forum is meant for questions and discussions about the XSharp Tools libraries, which contain code written by XSharp users that they want to share with others,
The development team is not responsible for this code

Moderator: wriedmann

User avatar
wriedmann
Posts: 3775
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Interest in WPF/MVVM Framework in X#

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
lumberjack
Posts: 728
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Re: Interest in WPF/MVVM Framework in X#

Post by lumberjack »

No objections this side Wolfgang.

Johan
______________________
Johan Nel
Boshof, South Africa
User avatar
AlessandroV
Posts: 88
Joined: Tue Oct 31, 2017 9:07 am
Location: Italy

Re: Interest in WPF/MVVM Framework in X#

Post by AlessandroV »

I think can be very interesting for me.

Alessandro
ic2
Posts: 1862
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Re: Interest in WPF/MVVM Framework in X#

Post 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.
Luc
Posts: 28
Joined: Sat Apr 30, 2016 7:31 pm
Location: Belgium

Re: Interest in WPF/MVVM Framework in X#

Post 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
FFF
Posts: 1589
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Re: Interest in WPF/MVVM Framework in X#

Post by FFF »

Wolfgang,
here too. Especially, if the "databinding" part is included and SIMPLE for noobs like me ;-)
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
wriedmann
Posts: 3775
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Interest in WPF/MVVM Framework in X#

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
ic2
Posts: 1862
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Re: Interest in WPF/MVVM Framework in X#

Post 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
User avatar
wriedmann
Posts: 3775
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Interest in WPF/MVVM Framework in X#

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
ic2
Posts: 1862
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Re: Interest in WPF/MVVM Framework in X#

Post 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 8-) 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
Post Reply