Presentation is loading. Please wait.

Presentation is loading. Please wait.

Session Code: CLI391 Windows Forms: Exploiting Windows “Longhorn” Features from Within Your Application Mark Boulter .NET Client Team Microsoft Corporation.

Similar presentations


Presentation on theme: "Session Code: CLI391 Windows Forms: Exploiting Windows “Longhorn” Features from Within Your Application Mark Boulter .NET Client Team Microsoft Corporation."— Presentation transcript:

1 Session Code: CLI391 Windows Forms: Exploiting Windows “Longhorn” Features from Within Your Application Mark Boulter .NET Client Team Microsoft Corporation

2 Client Application Model Web & Service Application Model
Tools Client Application Model Web & Service Application Model Data Systems Application Model Mobile PC & Devices Application Model Command Line Compact Framework Avalon Windows Forms ASP.NET / Indigo Win FS Yukon System.Console Mobile PC Optimized System.Windows System.Windows.Forms System.Web System.Storage System.Data.SqlServer System.Windows.Forms System.Windows NT Service System.ServiceProcess Presentation Data Communication System.Windows System.Search System.Data System.Messaging System. Discovery System.Collaboration UI Element Explorer Media Annotations SqlClient DataSet System.DirectoryServices RealTimeEndpoint Documents Controls Animation SqlTypes Mapping Active Directory TransientDataSession Monitoring System.Remoting Text Element Dialogs Controls SqlXML ObjectSpaces SignalingSession Logging System.Runtime.Remoting Uddi Shapes SideBar Control OdbcClient ObjectSpace Media Relevance Shape Notification Panel OleDbClient Query Activities Ink Navigation Design OracleClient Schema System.Web.Services System.MessageBus System.Storage Web.Service Transport Queue System.Windows.Forms System.Web.UI Item Core Description Port PubSub Forms Page WebControls Channel Router Relationship Contact Discovery Control Control Adaptors Service Policy Media Location Protocols Printing HtmlControls Design Peer Group Audio Message Design MobileControls Video Document System.Net Images Event System.Web System.Help System.Speech HttpWebRequest NetworkInformation System.Xml Personalization FtpWebListener Sockets System.Drawing Recognition Synthesis Caching Schema Xpath SslClientStream Cache System.NaturalLanguageServices Serialization Query SessionState WebClient Fundamentals Base & Application Services Security Configuration Deployment/Management System.Timers System.Text System.Collections System.Windows. TrustManagement System.Web.Configuration System.Security System.Web System.Globalization System.Design Generic System.MessageBus.Configuration Administration System.Serialization System.IO System.Web. Security Authorization Permissions System.ComponentModel System.Configuration Management System.Threading Ports AccessControl Policy System.CodeDom System.Resources System.Message Bus.Security Credentials Principal System.Management System.Runtime System.Reflection Cryptography Token System.Deployment Serialization InteropServices System.EnterpriseServices System.Diagnostics CompilerServices System.Transactions

3 Agenda Windows Forms and Longhorn
Using WinFX in Windows Forms applications Using Avalon in Windows Forms Using Windows Forms in Avalon Windows Forms and XAML What to do where and how and when

4 It’s a managed world. . . WinFX builds on the .Net Framework
Whidbey is the next step on the way to WinFX .Net Framework applications will just work on Longhorn If you know how to program managed you know how to program to Longhorn

5 It just works (better) Windows Forms apps just work on Longhorn
(No more redist install required - Hoorah!) Windows Forms apps get core improvements for free Example: ClickOnce improvements in Longhorn Example: TrustManager improvements in Longhorn Example: Config system improvements in Longhorn

6 demo Windows Forms & ClickOnce on Longhorn

7 Using WinFX with Windows Forms
Windows Forms can easily be extended to use WinFX APIs Example: Longhorn communications subsystem (Indigo) Example: Longhorn Storage Subsystem (WinFS) Example: Avalon People Picker control

8 demo Using WinFX with Windows Forms

9 Avalon and Windows Forms
Avalon provides a host of compelling new UI capabilities for Longhorn You can use Avalon to enhance an existing Windows Forms application Windows Controls You can use Windows Forms to bring existing functionality forward into a new Avalon application Forms Data Model works in both Avalon and Windows Forms

10 Avalon and Windows Forms
ElementHost A Windows Forms control that understands how to host Avalon controls WindowsFormsHost An Avalon control that understands how to host Windows Forms controls Forms and Windows just work

11 demo Avalon in Windows Forms

12 Windows Forms in Avalon
<?Mapping XmlNamespace="wfi" ClrNamespace="MSAvalon.Windows.Forms.Integration" Assembly="WindowsFormsIntegration" ?> <?Mapping XmlNamespace="wf" ClrNamespace="System.Windows.Forms" Assembly="System.Windows.Forms" ?> <DockPanel ID="root" xmlns=" xmlns:def="Definition“ xmlns:wfi="wfi“ xmlns:wf="wf"> <Button ID="button1" Click="startTest">Avalon StartTest</Button> <wfi:WindowsFormsHost ID="wfh1"> <wfi:WindowsFormsHost.Controls> <wf:FlowPanel Dock="Fill" BackColor="Green" AutoScroll="true"> <wf:FlowPanel.Controls> <wf:Button Click="Golly" BackColor="Red" Text="Test1"/> <wf:Button Click="Golly" BackColor="Red" Text="Test2"/> </wf:FlowPanel.Controls> </wf:FlowPanel> </wfi:WindowsFormsHost.Controls> </wfi:WindowsFormsHost> </DockPanel>

13 demo Windows Forms in Avalon

14 Windows Forms and XAML XAML: Windows Forms UI can be described in XAML
Declarative XML format for describing the relationship between managed objects Enables separation of UI from code Windows Forms UI can be described in XAML Windows Forms and Avalon controls can be mixed in XAML

15 Windows Forms in XAML <?Mapping XmlNamespace="wf" ClrNamespace="System.Windows.Forms" Assembly="System.Windows.Forms" ?> <?Mapping XmlNamespace="wfi" ClrNamespace="MSAvalon.Windows.Forms.Integration" Assembly="WindowsFormsIntegration" ?> <wf:Form Name="Form1" xmlns=" xmlns:def="Definition“ xmlns:wf="wf“xmlns:wfi="wfi"> <wf:Form.Controls> <wf:GroupBox Name="GroupBox1" Dock="Fill" BackColor="Purple" Text="Testing"> <wf:GroupBox.Controls> <wf:FlowPanel Dock="Fill" BackColor="Green" AutoScroll="true"> <wf:FlowPanel.Controls> <wf:Button Click="Golly" BackColor="Red" Text="Test1"/> <wf:Button Click="Golly" BackColor="Red" Text="Test2"/> </wf:FlowPanel.Controls> </wf:FlowPanel> </wf:GroupBox.Controls> </wf:GroupBox> </wf:Form.Controls> </wf:Form>

16 Avalon in Windows Forms
<?Mapping XmlNamespace="wf" ClrNamespace="System.Windows.Forms" Assembly="System.Windows.Forms" ?> <?Mapping XmlNamespace="wfi" ClrNamespace="MSAvalon.Windows.Forms.Integration" Assembly="WindowsFormsIntegration" ?> <wf:Form Name="Form1" xmlns=" xmlns:def="Definition“ xmlns:wf="wf“xmlns:wfi="wfi"> <wf:Form.Controls> <wf:GroupBox Name="GroupBox1" Dock="Fill" BackColor="Purple" Text="Testing"> <wf:GroupBox.Controls> <wfi:ElementHost Dock="Fill"> <DockPanel ID=“dp1" Width="100%" Height="100%"> <Button ID="button1" Background="Red">Avalon StartTest</Button> <Button ID="button2" >Avalon StartTest</Button> </DockPanel> </wfi:ElementHost> </wf:GroupBox.Controls> </wf:GroupBox> </wf:Form.Controls> </wf:Form>

17 demo Avalon in Windows Forms in XAML

18 Adaptive apps Avalon has great new features
Windows Forms runs on all Windows platforms How do I get the best of both worlds? Build applications that detect and use Longhorn features when available Ex: Replace Windows Forms GridView with Avalon ListView control when running on Longhorn Ex: Use People picker to get contact info when running on Longhorn

19 demo Adaptive Apps

20 Preparing for Whidbey and Longhorn
Start Developing with the .NET V1.1 Build and Deploy Windows Forms applications Develop with code access security in mind Use No-Touch Deployment XML config files for app/user settings Componentize logic and UI

21 When do I use what? If you are targeting Longhorn only use Avalon
If you targeting multiple versions of Windows use Windows Forms Use adaptive techniques to get the best of both worlds Separate logic and UI so that moving to Avalon is easier

22 Summary Windows Forms is part of WinFX and the Windows Client platform
Windows Forms provides a seamless path to Longhorn Windows Forms apps work seamlessly on Longhorn Windows Forms apps can easily use the Longhorn API Incremental Upgrade: Embed Avalon in Windows Forms Preserve Investment: Embed Windows Forms in Avalon

23 Call to action Move to managed code today: Build and deploy Windows Forms apps Plan to use Longhorn features: Componentize your app If you are targeting Longhorn use Avalon If you are targeting all Windows platforms use Windows Forms Build adaptive apps to take advantage of Longhorn when it is there

24 Related Sessions Windows Forms Avalon Panels
CLI210: Windows Forms: New Features in the .NET Framework "Whidbey" Release   CLI331: Windows Forms: Building Polished Applications with the .NET Framework "Whidbey" CLI211: Windows Forms: Performance Tips and Tricks            MBL303: Windows Forms: Building Occasionally-connected, Async Client Applications CLI330: Windows Forms: Mastering the GridView Control and Databinding in the .NET Framework "Whidbey"     Avalon CLI200: “Avalon”: Introducing the Next Generation of Windows Presentation Services CLI300: "Avalon": Building Applications with Controls and Dialogs CLI303: "Avalon": Creating Windows "Longhorn" User Experiences (Part 1): "Longhorn" Application Model Fundamentals CLI306: "Avalon": Using Data in Your "Avalon" Application: Data Visualization, Databinding and Integration with WinFS and Databases Panels PNL05: Client Architecture: The Zen of Data-Driven Applications

25 Community Resources Get Your Questions Answered!
Web Site: Newsgroups: microsoft.public.dotnet.framework.windowsforms  microsoft.public.dotnet.framework.windowsforms.controls microsoft.public.dotnet.framework.windowsforms.databinding microsoft.public.dotnet.framework.windowsforms.designtime microsoft.public.windows.developer.winfx.avalon Longhorn DevCenter: Client Track Lounge - Concourse Foyer connect with Microsoft client product teams and PDC 2003 Speakers Ask The Experts: Tuesday 7 pm – 9 pm in Hall G,H PDC Weblogs:

26 © 2003-2004 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

27


Download ppt "Session Code: CLI391 Windows Forms: Exploiting Windows “Longhorn” Features from Within Your Application Mark Boulter .NET Client Team Microsoft Corporation."

Similar presentations


Ads by Google