Windows Presentation Foundation

  • 1
  • Question
  • Updated 1 month ago
  • (Edited)
In the current FlexAPI download there is a C# project UiWpfFramework. I assume that this is to support Windows Presentation Foundation applications. Are there any sample code or documentation on the routines (other than the Doxygen auto generated stuff)?

If you are developing a FlexAPI with a Windows GUI are you using WinForms or WPF? Which do you recommend for a new project?
Photo of Mark Erbaugh

Mark Erbaugh

  • 512 Posts
  • 43 Reply Likes

Posted 2 months ago

  • 1
Photo of Mark - WS7M

Mark - WS7M

  • 1336 Posts
  • 501 Reply Likes
Hi Mark,

It is always a tough call to decide on the framework to use.

I don't know of any docs on the WPF routines provided by Flex but I think their functions are fairly clear.  I am fairly sure you could ask specific questions and someone from Flex development would have an answer.

I think the decision on which framework to use from M$ depends upon what you want to do.  Here is my take:

WinForms - This is what FRLogger is written in because I needed to develop it quite fast.  I find that WinForms development is about 3x faster than WPF.   Although you can cheat in WPF and save some time.

WinForms lacks the nice data binding that WPF provides.  Frankly this data binding can be very handy if you plan to have lots of similar data displaying in lots on different views.  You can reuse views, bind once to one data provider for all of them.  In WinForms you must populate your controls manually.

There are binding libs for WinForms but I have never tried to use them.

So the decision on WinForms versus WPF, versus say a console app really depends upon your needs.  I do find that WPF and UWP both add about 4x to the development since to do it right you need to futz with XAML and create view models for everything.   

If you have a very complex app then all that separation can be a good thing as WPF sort of pushes you towards the separation.  It is any in WinForms to mix responsibilities since you can just do stuff inside of button click events.

I spent many years developing in Delphi which is very much like WinForms.  We created very complex multi-threaded super responsive apps.  It just takes planning and careful coding.

I find that WPF while powerful and you can do some incredible things has a steep learning curve on the XAML side of things.  It is not intuitive to lay out a window.

The last thing I will add is that there are only a very few things you can do with WPF that you cannot do easily with WinForms.

Also WinForms and WPF are not being updated and maintained.  The big thing is UWP which I work in at work but absolutely hate.

Just my 2c

Mark - WS7M
(Edited)
Photo of Mark Erbaugh

Mark Erbaugh

  • 512 Posts
  • 43 Reply Likes
Mark,

Thanks for the reply.

My last serious Windows GUI app development was done 10+ years ago, also in Delphi. I can't see much use for data binding in my FlexAPI app nor for , so it sounds like WinForms might be the way to go.

I have created some very simple test apps forFlexAPI with both WinForms and WPF. 

I've not tried UWP, but I just started the download to add that to VS. With my slow internet, I won't be able to try it until tomorrow.

73,
Mark - N8ME
Photo of Pete - W6OP

Pete - W6OP

  • 38 Posts
  • 13 Reply Likes
Mark's (WS7M) explanation is right on. I'll just add that if the app is just for yourself then definitely use WinForms, much easier and quicker. Also easier to get help. If you prefer the geekier side of programming then try WPF. As far as UWP I can't tell you much. I retired from professional programming about the time it showed up. Now I mostly program on the Mac in Swift. I still do some WinForm apps for ham radio friends though.
Photo of Mark Erbaugh

Mark Erbaugh

  • 512 Posts
  • 43 Reply Likes
It looks like out of the box UWP and FlexLib is a no-go. I created a UWP solution and added the FlexLib, UiWpfFramework, Util and Vita projects to it, but when I tried to add a reference to FlexLib (or any of the others) to my UWP solution, VS complained that it can't add a reference.
Photo of Mark - WS7M

Mark - WS7M

  • 1336 Posts
  • 501 Reply Likes
Hi Pete, Mark,

It is possible to use FlexLib with UWP but you have to do some work wrapping it with some various things.

Another thing UWP is trying to do is to make Windows programs safer by restricting what the program can do.  Like writing files, connecting to internal network things, etc.  Personally I think it is strange and while I have to use it at work I don't really like it.

As Pete said, for personal use WinForms will work best.
Photo of Mark - W3II

Mark - W3II

  • 221 Posts
  • 46 Reply Likes
UWP programs can not use .NET Framework libraries. Remember there is .NET Core, .NET Framework, and .NET Standard. A .NET Framework program can use the .NET Standard library but not the other way around.
Photo of James Smith

James Smith

  • 6 Posts
  • 0 Reply Likes