Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET 4.5
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Amazon Web Services
Analysis Services
Android
Architecture
Arduino
ASP .NET Web API
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
BDD
Big Data
Bing
BizTalk
Book Excerpts
Build and Deploy
Business Intelligence
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE Framework Info - non Technical
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Debugger
Design Patterns
Development Process
Display Technologies
Distributed Computing
Document Database
DotNetNuke
DSL
Dynamic Languages
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
HTML 5
Internet Explorer 8.0
Interviews
IOS
iPhone
Iron Ruby
Java
Java Script
JavaScript
jQuery
JSON
Lightswitch
LINQ
Linux
LUA
Mac OS X
MDX
Messaging
Metro
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
MVVM
MySQL
Network
NHibernate
node.js
NOSQL
Nuget
Object Oriented Development
Objective C
Odata
OLAP
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
PHP
Podcasts
Post Mortem
PowerPoint
Print/Output
Prism
Product News
Product Reviews
Project Management
Prolog
Python
Q&A
Rails
Rake
Razor
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Scheme
Search
Security
Services
SharePoint
SignalR
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server 2012
SQL Server CE/AnyWhere/Mobile/Compact
SSIS
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
TFS
Tips
TypeScript
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 11
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio 2011
Visual Studio 2012
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WebMatrix
WF
Whitepapers
Windows 7
Windows 8
Windows Azure
Windows Live
Windows Phone 7
Windows Phone SDK
Windows Server
Windows Vista
WinForms
WinRT
Workflow
WPF
XAML
Xiine Documentation
XML
XNA
XSLT



Learn Now


rssbus
 


Xojo

Reader rating:
Click here to read 1 comment about this article.
Article source: CoDe (2006 - Jan/Feb)


Article Pages:  1  2 3 4 5 - Next >


An Overview of Windows Presentation Foundation

By now you should have heard of several new acronyms that are usually associated with Windows Vista (codenamed Longhorn).

These acronyms include WinFX, WinFS, WCF (Windows Communication Foundation; codenamed Indigo), and WPF (Windows Presentation Foundation; codenamed Avalon). In recent months there has been a lot of buzz going around WPF, which is one of the core components of WinFX. In this article, I will take you on a whirlwind tour of what WPF is and how you can start preparing for Vista by developing applications today using the available SDK.

Why Windows Presentation Foundation?

Windows Presentation Foundation (WPF) is the new graphics subsystem in Windows Vista that will enable developers to build applications that provide breakthrough user experiences. If you look at the applications in use today, they are either Windows applications or Web applications. While Windows applications offer immensely rich client functionality, deploying Windows applications requires considerable resources and makes maintenance a constant challenge. On the other hand, Web applications offers ease of deployment and maintenance, but do so at the expense of increased complexity in the development process (since the Web is stateless) as well as less-than-ideal platform integration.

"
It is the goal of WPF to offer a development platform that offers the best of both worlds, allowing administrators to deploy and manage applications securely.
"

Microsoft’s goal when they created WPF was to offer a development platform that offers the best of both worlds, allowing administrators to deploy and manage applications securely.

While application development technologies have evolved rapidly, hardware advances have also been moving at a rapid rate. In particular, the processing power of video cards has been improving at a much more rapid rate than developers can make use of. Increasingly, computers are equipped with an over-powered graphics subsystem that is under utilized. Applications could jolly well take advantage of the power of these graphics cards (such as for three-dimensional (3-D) processing) to enhance the user experience.

And this is exactly the aim of WPF-that is, to take advantage of the under-utilized power of the video card and use it to enhance the user experience of Windows applications. WPF uses Direct3D for vector-based rendering, enabling applications to incorporate a wide assortment of media such as 2-D, 3-D, audio, text, video, animation, etc.

Building User Interfaces Using XAML

In WPF, Microsoft introduces a new language for creating WPF applications-XAML (Extensible Application Markup Language). Using XAML, developers can create UIs declaratively using XML elements and attributes. This provides for a clean separation of application logic and the UI of the application, allowing interface designers to use external tools (more on this later) to design the UI and then wire up with the code-behinds using .NET languages.

XAMLPad

To get developers started with XAML, Microsoft provides a useful tool known as XAMLPad. XAMLPad is a XAML editor that allows you to quickly preview your UI. To use XAMLPad, go to Start, choose Programs, choose Microsoft Windows SDK, then choose Tools, and finally choose XAMLPad. Figure 1 shows the various components in XAMLPad.

Click for a larger version of this image.

Figure 1: The various components in XAMLPad.

XAMLPad offers the following functions:

  1. Auto Parse-The Preview Pane (7) will be updated as you type your XAML code in (8)
  2. Refresh-Refreshes the Preview Pane (7)
  3. Changes the font in the Code Edit Pane (8)
  4. Changes the font size in the Code Edit Pane (8)
  5. Hides the Code Edit Pane (8)
  6. Changes the scaling factor of the Preview Pane (7)
  7. Preview Pane
  8. Code Edit Pane
  9. Status bar

To see the XAMLPad in action, let’s populate the Edit Pane with some XAML code (see Listing 1). Figure 2 shows the resulting UI. Notice that the XAML code looks like HTML as all UI controls are defined declaratively.

Click for a larger version of this image.

Figure 2: Using XAMLPad to preview XAML code.

XAML supports a few layout patterns for UI controls, and the one just shown uses the Canvas layout. The Canvas layout pattern is similar to what you have today in Windows Forms. The controls in a Canvas layout are positioned using the x and y-coorindates. The Canvas layout is useful in cases where you need to precisely position the various controls on the UI.

You may have noticed that in the Canvas element there is a LayoutTransform attribute. This attribute allows you to scale the output by simply specifying the scale factor. For example, if you specify a factor of 0.5 (LayoutTransform="scale 0.5"), then the entire Canvas layout would shrink by 50% (see Figure 3).

Click for a larger version of this image.

Figure 3: Using LayoutTransform to shrink the output.

&

By: Wei-Meng Lee

Wei-Meng Lee is a technologist and founder of Developer Learning Solutions (http://www.learn2develop.net), a technology company specializing in hands-on training on the latest Microsoft technologies.

Wei-Meng speaks regularly at international conferences and is the author of ASP.NET 2.0: A Developer’s Notebook and Visual Basic 2005 Jumpstart (both from O'Reilly Media, Inc).

Wei-Meng is currently a Microsoft Device Application Development MVP.

Contact Wei-Meng at weimenglee@learn2develop.net.

Fast Facts

In the current version of Visual Studio 2005 (Release Candidate at the time of writing), there is no visual designer for WPF applications. That is to say, you cannot drag and drop controls from the Toolbox onto the design surface of a WPF application. You have to manually code using XAML (see Figure 9). However, it is expected that in the near future Microsoft will provide a visual designer for WPF applications.



Listing 1: Sample XAML code
<Canvas 
 xmlns="http://schemas.microsoft.com/winfx/avalon/2005
 Background="Ivory" LayoutTransform="scale 1">
   <Label 
      Canvas.Top="10" Canvas.Left="10" 
      BorderBrush="Crimson" BorderThickness="1">
      Image Source
   </Label>

   <TextBox Canvas.Top="40" Canvas.Left="10" >
   </TextBox>

   <Button Canvas.Top="40" Canvas.Left="120" 
      Height="25">OK</Button>
   <Image Width="400" Canvas.Top="75" 
      Canvas.Left="10" >
      <Image.Source>
         <BitmapImage UriSource="C:\Sunset.jpg" />
      </Image.Source>
   </Image>
</Canvas>


Article Pages:  1  2 3 4 5 - Next Page: 'Layouts' >>

Page 1: An Overview of Windows Presentation Foundation
Page 2: Layouts
Page 3: Building WPF Applications Using Visual Studio 2005
Page 4: 3-D Graphics
Page 5: Imaging

How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
1.9 out of 5

14 people have rated this article.

Hacker Halted

      Sharepoint TechCon

 

RssBus