1. WPF4 Abhimanyu Singhal Lead Consultant http://www.imentor.co.in/blog iMentor Knowledge Services
2. Objectives Give you a good understanding of what’s in WPF4.0 How to use new WPF 4.0 features Lots of Demos…..
3. Prerequisites A Sound understanding of WPF and XAML concepts Previous working experience with WPF will be helpful.
4. WPF Designer for Visual Studio 2010 “Type minimal of XAML” - Cider
5. Visual Data Binder Allows you to use and define bindings visually. DataContext, ElementName, RelativeSource, StaticResource Path, Converters,Options Use of data sources window Define data sources Add bound WPF Elements to your window/control Bind to existing elements Create master-details forms easily
6. Design Time Data d:DataContext, d:DesignInstance d:DesignInstance Properties IsDesignTimeCreatable(bool) Defaults to false CreateList (bool) Defaults to false How to use d:DataContext and d:DesignInstance
7. Property Value Source Locator Allows you to find from where a property is getting its value. Find our answers like why is my button Red
8. Enhanced Property Editors Search through properties Brush Selection Font Selection Extract value to a resource Apply a resource value Icons in the property editor
9. Easier Layout Options Right click and choose option reset layout All – Resets both margins, sizing and alignment properties of the control Sizing – Resets the height and width of the control Alignment – Resets the alignment of the control Margins – Resets the margins of the control Snap lines Modifying Z-Order Easier switching between fixed and dynamic size Grid Layout Control Enhancements Add Rows, Move Rows, Swap Rows, Delete Rows
10. XAML View Enhancements Markup extension intellisence Toggle markup trees Toggling element displays more info State is remembered when file is closed and opened again
11. Visual State Manager Enhanced support for creating visual states for a control Use control templates and yet provide states for different modes and transitions between different modes.
13. WPF DataGrid Auto generated Columns AutoGeneratedColumns(True,False) Column Type DataGridTextBoxColumn DataGridCheckBoxColumn DataGridComboBoxColumn DataGridHyperLinkColumn DataGridTemplateColumn DataTemplate for CellEditingTemplate DataTemplate for CellTemplate Selection Methods SelectionMode (Single, Extended) SelectionUnit (Cell, Row, CellOrRowHeader)
14. WPF DataGrid Continued… Row Details RowDetailsTemplate Validation Alternating Background Row & Column Headers Design Time (Visual Studio and Blend) Grouping Frozen Columns FrozenColumnCount Column sorting, reordering and resizing
15. WPF Calendar and DatePicker Blackout Dates (DatePicker.BlackoutDates) SelectionMode SingleRange, SingleDate, MultipleRange, None FirstDayOfWeek DisplayDate DisplayMode Month, Year, Decade Design time experience for both Blend and Visual Studio
17. Client Profile What is…? A Subset of .NET Framework 4.0 Optimized for client applications Provides functionality for most client apps including WPF Windows Forms WCF Click Once What does it enables…? Faster deployments Smaller Install Package (28 Mb)
18. What is not in .NET Framework Client Profile ASP.NET Advanced Windows Communication Foundation (WCF) functionality .NET Framework Data Provider for Oracle MSBuild for compiling
19. Targeting Client Profile Use Visual Studio Project Templates View/Change Target Framework If Adding Ref to .NET 4.0 based assemblies (They should not be referring to non-client profile assemblies )
20. Deploying .NET Framework Client Profile Click Once Use client profile as launch condition Available as Local Package and Web Package Very small size
21. Troubleshooting Targeting Errors Common errors the type or namespace name "name" does not exist in the namespace "namespace". (Are you missing an assembly reference?) Type "typename" is not defined. Could not resolve assembly "assembly". The assembly is not listed as part of the "profile" Profile. Common Causes You Have Referenced an Assembly That Is Not Included in the Client Profile You Have Referenced a Project or Assembly That Targets a Different Version of the .NET Framework You Have Re-Targeted a Project to a Different Version of the .NET Framework
29. Thank you Abhimanyu Singhal Lead Consultant http://www.imentor.co.in/blog abhimanyu@imentor.co.in iMentor Knowledge Services
Hinweis der Redaktion
Available as Local Package and Web InstallAll Platforms and CPU Architectures supported by .NET except IA64Part of the .NET Framework. The .NET Framework is made up of the .NET Framework 4 Client Profile and .NET Framework 4 Extended components that exist separately in Programs and Features.Independent component - Can be serviced separately and Does not need the .NET Framework 4 Extended component of the .NET Framework.Several project templates in Visual Studio 2010 target the .NET Framework 4 Client Profile. The following is a list of the project templates in Visual Studio 2010 that target the .NET Framework 4 Client Profile by default. All other projects target the .NET Framework 4 by default. WindowsWPF ApplicationWPF Browser ApplicationWPF Custom Control LibraryWPF User Control LibraryWindows Forms ApplicationWindows Forms Control LibraryConsole ApplicationEmpty ProjectWindow ServiceOfficeAll Office 2007 and Office 2010 project templatesWCFWCF Service LibraryWorkflowActivity Designer LibraryActivity LibraryWorkflow Console ApplicationVisual F#F# ApplicationF# Tutorial
You can view or change the target framework for a project in Visual Studio.If you attempt to reference an assembly in your project that is not included in the .NET Framework Client Profile, Visual Studio will display an error message.If your application targets the .NET Framework 4 Client Profile, you can add a reference to a class library that targets the .NET Framework 4 as long as that library does not reference any assemblies not included in the .NET Framework 4 Client Profile. If the library does include references to assemblies not in the .NET Framework 4 Client Profile, then Visual Studio will display an error message.