Windows Forms vs. WPF [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I've developed Windows Forms applications for 5 years now. A lot of people say that I should look into WPF. I have a few questions about WPF vs Windows Forms to determine which one is best. WPF is newer than Windows Forms and many people say it'll be the future. Others say that Windows Forms is older and therefor more secure. I am not sure what will be the future. I have googled advantages and disadvantages, but I hope that you can give me a more in dept answer to these questions:
Which one is better based upon performance?
What are the top advantages of using WPF instead of Windows Forms?
What are the top advantages of using Windows Forms instead of WPF?
Which one is more used/liked by businesses?
How hard is it to switch from Windows Forms to WPF?
Which parts of WPF should I definitely look into?

There is no meaning to say that WPF is better than windows forms or vice versa. It depends on many factors:
What kind of UI you are building.
Obviously, the complexity of the views you are designing will factor in to performance on both platforms. They have different layout and rendering pipelines.
How effectively you optimize for performance on each platform.
Advantages of using WPF instead of Windows forms:
XAML makes it easy to create and edit your GUI, and allows the work to be split between a designer (XAML) and a programmer (C#, VB.NET etc.).
It allows you to make user interfaces for both Windows applications and web applications (Silverlight/XBAP).
Databinding, which allows you to get a more clean separation of data and layout.
Uses hardware acceleration for drawing the GUI, for better performance.
Top advantages of using Windows forms instead of WPF:
WPF's in-box control suite is far more limited than that of WinForms.
There's greater support in the 3rd-party control space for WinForms. (That's changing, but for now by advantage of time, WinForms has greater support in the community.)
The major drawback of WPF is that Mono doesn't really support it for cross-platform (e.g., it doesn't work on Linux and Mac). Originally, Xamarian/Novella said they weren't going to implement it due to the complexity of implementation. I haven't seen anything to the contrary. Not saying it isn't, but their recommendation is to write model classes and then do a OS-specific front end. Even with WPF being open sourced, it may be built on something that isn't easily ported.
https://social.msdn.microsoft.com/Forums/en-US/e134134a-352f-435b-943a-eda7a2b14fc0/wpf-vs-windows-forms-2015?forum=wpf
Depends upon your learning ability.
Which parts of WPF should I definitely look into?
XAML: Learn about XAML and how it is used in WPF applications.
Layout: Learn about layout panels and how they are used to construct user interfaces.
Data binding: Learn how WPF data binding works and how it can be used.
Data templates and triggers: Learn how data templates and triggers work and how they can be used.
Styles: Learn about how UIs can be styled in WPF.
For more information refer below mentioned URL
Windows Form Vs WPF Windows

Related

Moving from WinForms c# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am writing a game in WinForms, using c#. Well, I absolutely love Visual Studio and WinForms, because coding is very simple, and there is usually no need in any additional content.
The game is text based, but it is also heavily based on UI. But, WinForms has no transparency, and this is something that hurts alot. Interface, labels and pictures are created and positioned dynamically.
I thought about moving to WPF, but I do not know, if i will be able to place controls dynamically in WPF like in WinForms (because WPF is based on grids).
Should I learn more about WPF, or there is any simple WinForms-like analogs, that support transparency and will allow me to create text-based games with UI?
P.S here is image, its QSP game (not mine, but it is something that I want to achieve, but have improved UI, transparent images, and etc.)
Since this is a multi-part question, I will not attempt to address any one specific question but rather provide resources to allow you to embark on learning WPF on your own, and assure you that moving to WPF is a safe choice for converting your application.
I thought about moving to WPF, but I do not know, if i will be able to place controls dynamically in WPF like in WinForms (because WPF is based on grids).
Yes, you can generate, create, and position content dynamically in WPF. See links for example code.
Should I learn more about WPF
Yes, you should learn more about WPF.
or is there any simple WinForms-like analogs, that support transparency and will allow me to create text-based games with UI?
Yes, you can create transparent windows and transparent controls in WPF.
I hope these resources are useful to you.

Is Windows Forms Application still a good option? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have not created Windows forms applications (using C# and .NET) since 2005 so I am not sure if it is still a good option for rich client applications. Also I do not know if there is any (comparatively) new framework for building Windows apps other than Composite Application Block.
We have a small team (3 people) in our company who manage the content (e.g. musics, mobile games etc) and I want to build a tool for them. Since there are only a few people who will use this tool I am thinking of creating a Windows app so that rather than spending time and effort on creating a rich Web UI (e.g. using ajax, jquery etc) I focus on the business logic.
I understand that WPF is another option but from my knowledge it is a bit more complicated and time consuming to build an app using WPF.
If Windows forms is my best option, is there any fairly new framework for building Windows apps? 10 years ago I used to use Microsoft's composite application block but it seems to me that it's something for the past!
Building an app using WPF is a bit double edged. It's extremely quick for building something simple, hence why so many tutorials can cover specific behaviours without being gigantic. It's excellent for having automatic layouts, and being able to build said layouts in XAML will feel a thousand times better than setting up alignments in forms, especially if you've done web development. However, deviating from the beaten path (smooth datatypes, good-or-error validation, hardcoded database fields...) will leave you with a steep learning curve, as I find digging around the guts of WPF to be a nightmare.
Note that there are also a number of options available for Mono, most of which also work on Windows without indcident.
EDIT: Since I'm still getting upvotes on this answer, apparently, I'll add that it doesn't seem mono is maintaining the attached page, and the only framework from the above list which appears to have ongoing support is Xwt.

Creating a Windows desktop app not a metro/store app [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I realize this may be a misplaced question on this forum but most other forums are less that useless!
I've been searching for tutorials on creating a Windows Desktop program, not a Windows Metro/Store app. All I can find is metro and store.
Can someone point me in the right direction for getting started on this? This is what I have chosen in VS2012:
vs2012 new windows empty project
I will eventually be importing an API but for now I want to get working on a GUI layout. Any pointers/clarification would be great.
If you want to create a Windows GUI app, you should use either Windows Forms Application or WPF Application. These are the primary two ways in which Windows desktop applications are created in C#. Note that the controls offered through these are different from one another, and the basic fashion in which the UI is constructed is totally different as well.
Windows Forms is fairly simple, and uses a visual designer to add controls to the form. WPF relies much more strongly on a complex markup based language, XAML, in which the UI is written in code. WPF offers a great deal more options as far as customizing controls and their appearances, but in order to use it to its greatest potential you have to spend a decent amount of time and frustration understanding how binding works within XAML.

C# User interface [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I have been programming in java for a couple of years now. Not long ago i decided that it was time to make a change and learn C#.
Now since it both visual studio and C# is new to me i have decided that since i have to learn it anyway i might learn the newest tools there is.
However i am unable to find out what GUI liberay to use. my first search indicated that WPF is the newest "lib" for creating microsoft UI many other threads gave an indication of that this might not be the case.
Therefore i am asking you guys what is the newest UI "lib" for C# and what would you advice me to use?
As pointed out by Giedrius, either Windows Forms or WPF.
Personally, i would start with Forms for a few weeks, get to know the environment, then move on to WPF and the lovely world of XAML.
WPF is the right technology if you are targeting users with good machines. It leverage the power of graphics card and supports vector graphics. You will get good development speed with the XAML system and much more
If you are looking for any third party controls you can evaluate Infrajistics or Telerik.But depends on your UI requirements.
In terms of newest technologies then WPF is certainly the one I'd recommend you learn, but there is quite a level of interoperability between WPF and WinForms, i.e. you can host WinForm controls in WPF and (I think) vice versa.
One thing to be aware of is that WPF is a completely different beast to winforms - you can still do the usual drag and drop, but for fancy stuff you need to be changing the XAML and that can take some getting your head around.
Edit - it's worth taking the effort to learn WPF though because once you have then you'll be producing rich interfaces with ease.
For anything prior to Windows 8 then the latest is WPF. As of Windows 8 you have Metro (name changed I know) but then you could still use your newly aquired XAML skills (picked up from WPF) or start getting into HTML 5 and CSS 3 which would also stand you in good stead for web-based applications.
Win Forms is older than WPF but still well loved / established and can be useful in places. Like most things, choose the right tool for the job.
There are two main flavors of GUI (not counting web): WPF and Windows Forms. WPF is much more recent and if you have no experience on Windows Forms, WPF may be recommended GUI alternative.
Now WPF may have several "flavours" - it is kind of different in abilities in desktop applications, silverlight applications and windows store applications, desktop applications having most of the features, other two has limited set, mostly because of performance and security reasons (for example you can't render UI to image in windows store applications, but in desktop applications you can).
WPF has better hardware acceleration support, has better binding and async/threading support, is much more flexible, many elements look may be changed very easily - which can't be done so easy in Windows Forms, like combo box - you can change color in Windows Forms very easily, but if you will need rounded edges, that will be hard one.
Also WPF can be used in MVVM pattern easily, which is quite a challenge in Windows Forms.
Windows Forms on the other hand is little bit easier to learn + plus it has very good third party components - like Telerik, Devexpress. Both vendors have components for WPF also, but they ain't as good as Windows Forms ones, mostly because they were designed using Windows Forms knowledge, which doesn't fit WPF.
I recommend you to learn html, css and js. As I know you can build Microsoft Windows 8 .net applications using these languages. Check here and also it would be useful if you'll decide to make web application, where all these languages are using also.
If you don't want to limit your self with Windows 8, than try WPF. Applications on WPF will be able to run on any machine with .net framework version you used for application.
GL
As others have pointed out, WPF is the way to go.
One thing that has not been mentioned is that, (since you have java experience) you can think of WPF versus other technologies (such as winforms) the same way you can think of JavaFX versus previous java UI technologies (such as Swing).
Actually, JavaFX seems like a really poor copy of WPF. the language used to define the UI is XML-based (like XAML is), it has (much poorer) support for DataBinding, and many other similarities.

What is new since Family.Show? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am relatively new to WPF and have been looking at Family.Show. It looks like a great reference application, but it has not been updated since February 2009. When I am looking through this code, are there any outdated techniques in here or improvements in the platform that I should be aware of?
[Edit] I have gotten a number of responses about PRISM and MVVM. I can now see how this question was not clear. Family.Show is one of the few WPF applications that I think really looks like a nice WPF application. I would like to use it as a model, but am concerned that the XAML and controls that they use might have been replaced with newer elements. Would someone give me some guidance in this respect?
[Edit] I should mention that I have read WPF 4 almost in its entirety, but not having much experience actually writing WPF applications, it is not easy for me to spot old or outdated technologies in something like Family.Show.
On the WPF side of things, not much has changed since 2009.
There are still DataTemplates, Styles, Data binding etc. They are used just like they have been used back then.
In the current version of the .NET framework a few more controls are present out of the box, so you might find some user controls in that example that are no longer necessary. However, the existing controls haven't changed as far as I know.
However, that application doesn't make any use of MVVM, which I personally find a big drawback.
So, you can use the application as a means to study WPF, but you shouldn't adept its architecture style in your own applications.
I think Prism is a very good framework to build enterprise(bigger) applications but at first sight it could be a little difficult. If you are new to WPF but want to get to know the WPF and MVVM better, check http://caliburnmicro.codeplex.com/ or http://waf.codeplex.com/. (With them it is a little easer to understand the principles.) You can get the source too and it is a good documentation to both, so you can learn a lot.
I think it is important to be familiar with the MVVM principles as a WPF developer.
I can suggest to you to watch the following two video from MIX conferences too:
http://channel9.msdn.com/events/MIX/MIX10/EX14
http://channel9.msdn.com/events/MIX/MIX11/OPN03
I would have a look at prism - its a great way to build WPF apps.

Categories