marți, 20 aprilie 2010

[2]WPF - Windows Forms

WPF - WinForms 


WPF Advantages:

  • Use a declarative approach
  • It is built with the presentation layer in mind
  • It is possible to host Windows Forms controls within the WPF environment, as well as to host WPF controls within the Windows Forms environment. 
  • WPF separates the appearance of an user interface from its behavior.
    • Appearance and behaviour are loosely coupled
    • Designers and developers can work on separate models.
    • Graphical design tools can work on simple XML documents instead of parsing code
  • Rich composition

    • Controls in WPF are extremely composable. (Samples: Put an image into a button to create an image button, or put a list of videos into a combobox to choose a video file)
  • Highly customizable
    • The concept of styles let you skin controls almost like CSS in HTML. 
    • Templates  let you replace the entire appearance of a control
  • Resolution independence
    • All measures in WPF are logical units - not pixels. A logical unit is a 1/96 of an inch. If you increase the resolution of your screen, the user interface stays the same size
  • WPF uses a "painter's algorithm" painting model. This means that instead of clipping each component, each component is asked to render from the back to the front of the display. This allows each component to paint over the previous component's display. The advantage of this model is that you can have complex, partially transparent shapes.
  • WPF has full support for property binding, transformation, and list binding.
  • WPF provides a new concept to the UI development effort: the trigger. Triggers are used to control and manipulate the visual representation of a control’s style elements within a window
  • WPF uniquely offers things such as 3D graphics and animations
  • WPF is the platform of choice for today’s visually demanding applications with its inherent support of rich media, data visualization, complex text content, dynamic interactive experiences, and branded or custom look and feel
  • Transformations let you move, scale, and rotate elements
  • Multimedia controls make it easier than ever to include audio and video in your applications.
  • The new FlowDocument control lets you build complicated documents containing text, shapes, images, and even WPF controls.


WPF Disadvantages:

  • WPF will not run on windows 2000 or lower
  • RAM can go up or down depending on your implementation. WPF stores its data more efficiently so individual objects are smaller, but there tend to be more objects in WPF than in WinForms so this balances out, and either one can come out ahead.
  • It is complex. Some of WPF's features are complicated and confusing
  • Microsoft Expression Blend is another tool (not for free)
  • All the controls available to the developer are brand new native .NET controls built to render in the new graphics platform. This means that all the GUI should be changed from WinForms to WPF
  • Microsoft did not provide 100 percent of the Windows Forms controls as corresponding WPF controls. (This is not a problem, as you can utilize the concept of interoperation to host Windows Forms controls where a corresponding WPF control does not exist.)
  • If you’re targeting the web, Silverlight shares the same development model as WPF but is optimized for a lightweight, cross-platform runtime. 
  • For Grids the complexity is higher like in case of WinForms

WinForms:

  • It is a mature technology. 
  • You will get better support for 3rd party controls.
  • Most developers already know WinForms; WPF provides a new learning curve.
  • Use an imperative approach.
  • WinForms Visual Design in Visual Studio 2005 generates code for every control dragged onto the design surface, which in turn is compiled with the rest of the application code into an executable .NET assembly.
  • Forms has a wide range of controls.

Niciun comentariu:

Trimiteți un comentariu