Thursday, August 12, 2010

Wednesday, July 21, 2010

The Motivation behind WPF....

Historically speaking, building a desktop UI under the Windows OS involved using a handful of key services: • User32: Provided the code required to create windows, controls, and application infrastructure. • GDI: Provided a framework for rendering 2D graphical data. • DirectX: If an application required high-performance graphical rendering (multimedia applications, video games, rich interactive front ends, and so on), DirectX was the way to do so.Although Windows programmers could make use of these services using C or C++, many UI toolkits were introduced over the years. VB6, MFC, Windows Forms, GDI+, and so on. Each one of them was simply a wrapper around User32 / GDI. These toolkits still viewed DirectX as an ‘external’ service. Windows Presentation Foundation (WPF) is a brand-new GUI toolkit that shipped beginning with NET 3.0.The core WPF object model is similar, but not identical to, Windows Forms. The release of WPF does not imply that Windows Forms is obsolete. In fact, the .NET platform will support this API for years to come. Like other .NET 3.0 / 3.5 technologies, WPF can be used under XP, Vista, or Windows Server 2003 and higher. The .NET 3.0 / 3.5 libraries ship automatically with Vista. Other OSs will require a separate installation of the 3.0 / 3.5 libraries through the freely downloadable .NET runtime installation program (the 3.5 version of dotnetfx.exe).Before the release of WPF, UI developers were forced to master a number of related, but ultimately independent, APIs. This required developers to ‘switch gears’ when moving from one task (e.g., building a main window) to another (e.g., 3D graphical rendering). The end result was a very asymmetrical way to program. Consider the GUI development world before .NET 3.0:With the release of WPF, things have improved considerably. You now have a single symmetrical manner in which to interact with the necessary GUI infrastructure. Consider the GUI development world as of .NET 3.0 and higher:Beyond offering a unified programming model, WPF also provides a clear separation of concerns. It is now possible to separate the look and feel of a GUI application from the programming logic that drives it. This is achieved using an XML-based grammar termed XAML (‘zam-el’). While most WPF applications will make use of XAML, doing so is entirely optional.This separation of concerns (via XAML) makes it much simpler for graphical designers to build very rich, professional UIs. Graphically minded individuals can use dedicated design tools such as Microsoft Expression Blend to generate the XAML. These XAML files can then be passed to the programming team to add logic to drive the UI (event handlers, method overrides, and so on). Better yet, a Microsoft Blend project uses exactly the same format as a Visual Studio project.Beyond the introduction of XAML, WPF also provides a good number of integrated services, including (but not limited to) the following: • A number of layout managers that provide full control over placement and repositioning of content. • A built-in style engine, which allows you to define ‘themes’ for a WPF application. • Native use of vector graphics, which allows an image to be automatically resized to fit the size and resolution of the screen hosting the application. • A rich typography API such as support for XPS (XML Paper Specification) documents, fixed documents (WYSIWYG), flow documents, and document annotations (e.g., a Sticky Notes API). • Integrated 2D and 3D rendering services / animation services, which leverage DirectX for hardware acceleration. In fact, all rendering, even the rendering of UI elements (buttons, and so on) is preformed via DirectX. • Support for audio and video media.Overall, WPF can be considered a ‘supercharged’ UI framework. WPF is extremely useful when you need to build highly interactive, stylized front ends. Real-time rotation of 3D bar charts, spinning a portion of a UI to a 45-degree angle, and dynamic shadowing on a rendered image are all possible.Consider the following WPF application (an example project from Expression Blend). Clicking on any buttons on the bottom of the application will rotate and animate a motorcycle prototype. Each button has a custom animation, performed when the cursor travels over the surface. While all of this could be done without WPF, doing so would require a considerable amount of complex code. Because WPF applications are so graphically intensive, a production-level WPF application will require the aid of a professional graphic designer. You may agree that most .NET programmers are not the best of artists. Likewise, most artists are not the best of .NET programmers. Using XAML and tools such as Visual Studio and MS Expression Blend, each part of the team can use dedicated tools, thus increasing efficiency in development. Remember that the same Visual Studio WPF application can be opened in Expression Blend. This is not to suggest that you cannot use WPF to build ‘traditional’ GUIs (gray push buttons, a grid, a menu system, and so on). You can certainly use WPF to build traditional business applications. However, this API is strongly geared for next-generation GUI applications. WPF is closer to the ‘Hollywood vision’ of what computer applications should look like (e.g., 3D spinning e-mail messages, glowing animated blocks of text, and the like).GUI applications that do not need this extra horsepower still gain benefits (separation of concerns, object model integration, and more). However, in some cases, Windows Forms may provide a more direct development path. Be aware that some of these ‘supercharged’ graphic features of WPF will require a ‘semi-supercharged’ machine to run them at an acceptable rate. Testing is always a good idea.

New C# Features in the .NET Framework 4

1)Covariance and Contravariance
2)Dynamic Dispatch
3)Dynamic and the DLR
4)Named Arguments and Optional Parameters
5)Indexed Properties
6)Omitting the Ref Keyword at COM Call Sites
7)Embedding COM Interop Types
http://msdn.microsoft.com/en-us/magazine/ff796223.aspx

Monday, July 19, 2010

Every developer needs a blog !!!

Being a .net develper ,this statement really impressed/motivated me a lot .. to update my blog.! its a great idea to share our technical knowledge through blogs ,by sharing the knowledge the individual fosters himself /herself as well as others.. Untill today i loved going through blogs .. from today onwards ,i would love to update my blog with something intresting (technical or general) that i come across.