Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. What is the big deal with WPF?

What is the big deal with WPF?

Scheduled Pinned Locked Moved The Lounge
csharpwpfquestionc++winforms
20 Posts 15 Posters 23 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J jesarg

    WPF is an old technology now; it's not normal to have WPF vs. Winforms conversations anymore. With that being said, when WPF was being developed, a number of factions were pressuring Microsoft to make significant changes to Windows client development, forcing them to come out with WPF (officially released in 2008). 1. Test-driven development became a major industry trend after Kent Beck published the first TDD book in 2002. To facilitate test-driven code, people wanted more separation of the UI logic and business logic, resulting in both XAML (making some of the UI code declarative rather than imperative) and patterns such as MVVM (which avoids many problems that make event-driven UI code difficult to unit test). 2. Using graphics hardware effectively was important to some people, and Winforms used old software rendering for graphics. WPF does hardware rendering. 3. Some people wanted better control over avoiding the problems associated with large numbers of developers maintaining one application. Microsoft came out with the Prism library with WPF to appease that crowd. With that all being said, after creating WPF, Microsoft did a poor job of improving it and fixing its issues. Winforms had to compete with Java Swing, Borland products, and other competitors, while WPF didn't have any serious competition, so Microsoft refused to allocate many resources towards improving it.

    F Offline
    F Offline
    FIorian Schneidereit
    wrote on last edited by
    #9

    I think it's important to point out that while WPF might be considered "old technology", many aspects of it are more alive than ever in form of Windows apps. In fact, the whole Windows Runtime UI stack is just a reimplementation of the same core WPF/Silverlight concepts in native code (the property system, the data binding, templating etc.) You just have to take a glance at the similarities of the Windows.UI.Xaml and System.Windows namespaces to get the idea. You could brand that as based on WPF-technology, and it probably wouldn't exist without WPF in the first place. But it's true that WPF was kind of left in the cold after it's release, and since the improvements that were made for .NET 4.0 (those were necessary because they rebuilt the Visual Studio UI on WPF during this period of time and found out how much performance and text rendering sucked in the real world on a large scale application), the platform was obviously considered mature and put into maintainance mode and the focus went to the Windows Runtime. Even though they try to revive it a bit recently, I think there's no doubt it's already on the way to be phased out over time in favor of Windows apps. I'm not a fan of the new Windows app model and a little disappointed about the fate of WPF. After all, it's really nice to work with and from an API perspective one of the better frameworks Microsoft ever built. It's a little harder to learn than Windows Forms, but once you understood and got used to its concepts, you really see how powerful it is.

    A 1 Reply Last reply
    0
    • S swampwiz

      (NOTE: I was a pre-.NET VC++ and then a WinForms C# guy after that, up until I "retired".) Other than just having a completely new API with slightly different names & signatures for functions - and perhaps some better software capability (i.e., that seems to be something that could have been incorporated into WinForms) - the only thing I can come up with it is that it is designed to work with XAML files & has a new way of doing data binding. I guess XAML was a big step and required a completely new API.

      M Offline
      M Offline
      markmnl
      wrote on last edited by
      #10

      For me its not so much about design patterns or industry trends, it is about capabilities: Dynamic Layouts In Win Forms you often layed everything out with absolute positions on a "canvas". In WPF one quickly learns to use the dynamic layout capability of different panels so your app works at different resolutions, window sizes etc. and adapts. Control Customisation You can completely overhaul the look and feel of every control with a little XAML to completely fit your vision - with Win Forms you had to work the properties you had - with WPF can you replace all the parts and it still works, e.g. a ListBox can appear as a Solar System.

      G 1 Reply Last reply
      0
      • G GuyThiebaut

        I have only used it for my non-work projects however I have found that in learning some WPF and implementing some WPF projects it has improved my understanding of how to 'code' well. In needing to learn MVVM, MVC etc design patterns it has had a very positive influence on my workday projects which are largely winforms projects. So WPF may not be the fastest platform on which to develop however it did force me to learn better ways of developing and thinking about IT problems. For that alone I have found WPF to be helpful - I find it helps me to learn new ways of thinking about or approaching problems and for me that is a good thing.

        “That which can be asserted without evidence, can be dismissed without evidence.”

        ― Christopher Hitchens

        V Offline
        V Offline
        Vark111
        wrote on last edited by
        #11

        This was actually a boon for Winforms development. Those patterns (MVC, MVVM, MVP) already existed, they just weren't widely used. WPF brought them to the fore of the desktop developer hivemind, and WinForms project development has improved because of it.

        1 Reply Last reply
        0
        • P PIEBALDconsult

          Dunno. WinForms still does everything I need.

          D Offline
          D Offline
          Dan Neely
          wrote on last edited by
          #12

          Did you get DPI scaling right? That's been the bane of all the old winform apps I still nominally support but have no budget to do any real fixes on. Based on an entirely unscientific study of 'this is messed up' complaints from a coworker who normally runs at a 125% zoom desktop it seems likely that everywhere I wrote custom layout/resize code is messed up. I suspect that I just need to add a GetDpiScalingFactor() call to the method start and apply it to everywhere I'm calculating sizes/spacings/offsets; but as there's no real maintenance budget for any of the apps I've never been able to investigate it effectively. (Well, that and the inability to run anything newer than w7, which requires a login/out to change DPI scaling, on the work network. :sigh: ) Edit: I suspect this is going to come to a head a few years down the line when even the cheapest Dell Latitude's come with high DPI screens that require using DPI scaling for anything to be readable. I also suspect the no money problem will still be present. :doh:

          Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

          1 Reply Last reply
          0
          • P PIEBALDconsult

            Dunno. WinForms still does everything I need.

            H Offline
            H Offline
            Herbie Mountjoy
            wrote on last edited by
            #13

            I agree that it is difficult to master. At first I thought it was the product of a tortured mind. I still use forms but slowly the obtuse xaml approach is beginning to make a little sense. I guess it will be a while before I become an evangelist.

            I may not last forever but the mess I leave behind certainly will.

            1 Reply Last reply
            0
            • F FIorian Schneidereit

              I think it's important to point out that while WPF might be considered "old technology", many aspects of it are more alive than ever in form of Windows apps. In fact, the whole Windows Runtime UI stack is just a reimplementation of the same core WPF/Silverlight concepts in native code (the property system, the data binding, templating etc.) You just have to take a glance at the similarities of the Windows.UI.Xaml and System.Windows namespaces to get the idea. You could brand that as based on WPF-technology, and it probably wouldn't exist without WPF in the first place. But it's true that WPF was kind of left in the cold after it's release, and since the improvements that were made for .NET 4.0 (those were necessary because they rebuilt the Visual Studio UI on WPF during this period of time and found out how much performance and text rendering sucked in the real world on a large scale application), the platform was obviously considered mature and put into maintainance mode and the focus went to the Windows Runtime. Even though they try to revive it a bit recently, I think there's no doubt it's already on the way to be phased out over time in favor of Windows apps. I'm not a fan of the new Windows app model and a little disappointed about the fate of WPF. After all, it's really nice to work with and from an API perspective one of the better frameworks Microsoft ever built. It's a little harder to learn than Windows Forms, but once you understood and got used to its concepts, you really see how powerful it is.

              A Offline
              A Offline
              Andres Cassagnes
              wrote on last edited by
              #14

              Once again I get in late. I'm starting to work with WPF and find it really nice (and I am saying 'nice' to a Microsoft thing). I like it very much. But being an 'outsider' of Microsoft world I just realize that it's old technology. Which is the trendy way of making windows applications if I can ask? For me, comming form the C++ Qt world, WPF is a great envirovment for window apps and I feel a little sad about the no-support that Microsoft gives to it. Regards. Andres C.

              F 1 Reply Last reply
              0
              • M markmnl

                For me its not so much about design patterns or industry trends, it is about capabilities: Dynamic Layouts In Win Forms you often layed everything out with absolute positions on a "canvas". In WPF one quickly learns to use the dynamic layout capability of different panels so your app works at different resolutions, window sizes etc. and adapts. Control Customisation You can completely overhaul the look and feel of every control with a little XAML to completely fit your vision - with Win Forms you had to work the properties you had - with WPF can you replace all the parts and it still works, e.g. a ListBox can appear as a Solar System.

                G Offline
                G Offline
                GuyThiebaut
                wrote on last edited by
                #15

                The solar system link was really interesting:thumbsup: This is part of the reason that I like WPF it allows us as developers to do what we want with much less restriction than winforms - also part of the pleasure is in solving the puzzles that crop up when developing WPF(you know something is possible, you just don't at the moment know exactly how you are going to implement the idea).

                “That which can be asserted without evidence, can be dismissed without evidence.”

                ― Christopher Hitchens

                1 Reply Last reply
                0
                • A Andres Cassagnes

                  Once again I get in late. I'm starting to work with WPF and find it really nice (and I am saying 'nice' to a Microsoft thing). I like it very much. But being an 'outsider' of Microsoft world I just realize that it's old technology. Which is the trendy way of making windows applications if I can ask? For me, comming form the C++ Qt world, WPF is a great envirovment for window apps and I feel a little sad about the no-support that Microsoft gives to it. Regards. Andres C.

                  F Offline
                  F Offline
                  FIorian Schneidereit
                  wrote on last edited by
                  #16

                  Now, the trendy way they (Microsoft) want you to build new applications for Windows is Universal apps a.k.a Store apps. From a design perspective, building such an app is pretty familiar to how you do it in WPF or Silverlight. If you already know how to work with XAML and code-behind, you're all set to go, there are just a some limitations and missing features you have to deal with. The downside is that those apps won't be running on older versions of Windows than 8, heck, apps built for Windows 10 won't even work on Windows 8/8.1. Plus, they have to be distributed via the Store. They're opening up the Store restriction a little bit for individuals with Windows 10 and you can enable side-loading of apps (officially, this is only meant for developers and testing purposes), but still it feels weird to have this rather restrictive foundation on a Windows desktop OS, and the sandboxing actually doesn't help if you need access to lower-level system APIs. Therefore, WPF (and even Windows Forms) is still the way to go on the Windows desktop for some time because your applications will work out of the box on every supported version of Windows, not just the current ones, and you don't have to deal with a Store and certification for distribution.

                  A 1 Reply Last reply
                  0
                  • P PIEBALDconsult

                    Dunno. WinForms still does everything I need.

                    M Offline
                    M Offline
                    Matt McGuire
                    wrote on last edited by
                    #17

                    never saw the appeal of WPF myself when winforms handles everything I need to do. maybe I have some old bias, but when WPF first came out it was sluggish and awkward, where winforms just work. oh sure it doesn't have all the pretty graphical translation capabilities, but winforms has an easier model to work with for us one person shops.

                    P 1 Reply Last reply
                    0
                    • M Matt McGuire

                      never saw the appeal of WPF myself when winforms handles everything I need to do. maybe I have some old bias, but when WPF first came out it was sluggish and awkward, where winforms just work. oh sure it doesn't have all the pretty graphical translation capabilities, but winforms has an easier model to work with for us one person shops.

                      P Offline
                      P Offline
                      PIEBALDconsult
                      wrote on last edited by
                      #18

                      I concur.

                      1 Reply Last reply
                      0
                      • S swampwiz

                        (NOTE: I was a pre-.NET VC++ and then a WinForms C# guy after that, up until I "retired".) Other than just having a completely new API with slightly different names & signatures for functions - and perhaps some better software capability (i.e., that seems to be something that could have been incorporated into WinForms) - the only thing I can come up with it is that it is designed to work with XAML files & has a new way of doing data binding. I guess XAML was a big step and required a completely new API.

                        R Offline
                        R Offline
                        Rollin Shultz
                        wrote on last edited by
                        #19

                        WPF can become the next big thing if some really good developers decide to build some applications that are very GPU intensive. The only other way to create an application that can do realtime graphics rendering and 3D structures with texturing and lighting without WPF is to handle it with Direct X. Until some fantastic apps come out that only guys with wild rigs can run, WPF will not ever get used fully and show its glory. I plan to develop a 3D desktop to take the place of rainmeter, Jarvis and a few others as an all in one interactive desktop as soon as I get the extra time. But for now, bread on the table baby.

                        1 Reply Last reply
                        0
                        • F FIorian Schneidereit

                          Now, the trendy way they (Microsoft) want you to build new applications for Windows is Universal apps a.k.a Store apps. From a design perspective, building such an app is pretty familiar to how you do it in WPF or Silverlight. If you already know how to work with XAML and code-behind, you're all set to go, there are just a some limitations and missing features you have to deal with. The downside is that those apps won't be running on older versions of Windows than 8, heck, apps built for Windows 10 won't even work on Windows 8/8.1. Plus, they have to be distributed via the Store. They're opening up the Store restriction a little bit for individuals with Windows 10 and you can enable side-loading of apps (officially, this is only meant for developers and testing purposes), but still it feels weird to have this rather restrictive foundation on a Windows desktop OS, and the sandboxing actually doesn't help if you need access to lower-level system APIs. Therefore, WPF (and even Windows Forms) is still the way to go on the Windows desktop for some time because your applications will work out of the box on every supported version of Windows, not just the current ones, and you don't have to deal with a Store and certification for distribution.

                          A Offline
                          A Offline
                          Andres Cassagnes
                          wrote on last edited by
                          #20

                          Thanck you for the answer. It was very clear. So I will still using WPF for my apps. It's some kind of weird the way Microsoft is doing the things with the window apps developement, but is Microsoft after all, it has not be much sorprising.

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups