Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

Windows Presentation Foundation

Mark Erbaugh
Mark Erbaugh Member ✭✭
edited February 2020 in SmartSDR API
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?

Answers

  • Mark_WS7M
    Mark_WS7M Member ✭✭✭
    edited August 2019
    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
  • Mark Erbaugh
    Mark Erbaugh Member ✭✭
    edited February 2020
    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
  • Pete - W6OP
    Pete - W6OP Member ✭✭
    edited August 2019
    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.
  • Mark Erbaugh
    Mark Erbaugh Member ✭✭
    edited August 2019
    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.
  • Mark_WS7M
    Mark_WS7M Member ✭✭✭
    edited August 2019
    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.
  • Mark_W3II
    Mark_W3II Member ✭✭✭
    edited August 2019
    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.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.