Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Windows presentation foundation 4

2,442 views

Published on

Published in: Technology
  • Be the first to comment

Windows presentation foundation 4

  1. 1. WPF4<br />Abhimanyu Singhal<br />Lead Consultant<br />http://www.imentor.co.in/blog<br />iMentor Knowledge Services<br />
  2. 2. Objectives<br />Give you a good understanding of what’s in WPF4.0 <br />How to use new WPF 4.0 features<br />Lots of Demos…..<br />
  3. 3. Prerequisites<br />A Sound understanding of WPF and XAML concepts<br />Previous working experience with WPF will be helpful.<br />
  4. 4. WPF Designer for Visual Studio 2010<br />“Type minimal of XAML” - Cider<br />
  5. 5. Visual Data Binder<br />Allows you to use and define bindings visually.<br />DataContext, ElementName, RelativeSource, StaticResource<br />Path, Converters,Options<br />Use of data sources window<br />Define data sources<br />Add bound WPF Elements to your window/control<br />Bind to existing elements<br />Create master-details forms easily<br />
  6. 6. Design Time Data<br />d:DataContext, d:DesignInstance<br />d:DesignInstance Properties<br />IsDesignTimeCreatable(bool) Defaults to false<br />CreateList (bool) Defaults to false<br />How to use d:DataContext and d:DesignInstance<br />
  7. 7. Property Value Source Locator<br />Allows you to find from where a property is getting its value. <br />Find our answers like why is my button Red<br />
  8. 8. Enhanced Property Editors<br />Search through properties<br />Brush Selection<br />Font Selection<br />Extract value to a resource<br />Apply a resource value<br />Icons in the property editor<br />
  9. 9. Easier Layout Options<br />Right click and choose option reset layout<br />All – Resets both margins, sizing and alignment properties of the control <br />Sizing – Resets the height and width of the control <br />Alignment – Resets the alignment of the control <br />Margins – Resets the margins of the control <br />Snap lines<br />Modifying Z-Order<br />Easier switching between fixed and dynamic size<br />Grid Layout Control Enhancements<br />Add Rows, Move Rows, Swap Rows, Delete Rows<br />
  10. 10. XAML View Enhancements<br />Markup extension intellisence<br />Toggle markup trees<br />Toggling element displays more info<br />State is remembered when file is closed and opened again<br />
  11. 11. Visual State Manager<br />Enhanced support for creating visual states for a control<br />Use control templates and yet provide states for different modes and transitions between different modes.<br />
  12. 12. WPF 4.0 New Controls<br />
  13. 13. WPF DataGrid<br />Auto generated Columns<br />AutoGeneratedColumns(True,False)<br />Column Type<br />DataGridTextBoxColumn<br />DataGridCheckBoxColumn<br />DataGridComboBoxColumn<br />DataGridHyperLinkColumn<br />DataGridTemplateColumn<br />DataTemplate for CellEditingTemplate<br />DataTemplate for CellTemplate<br />Selection Methods<br />SelectionMode (Single, Extended)<br />SelectionUnit (Cell, Row, CellOrRowHeader)<br />
  14. 14. WPF DataGrid Continued…<br />Row Details<br />RowDetailsTemplate<br />Validation<br />Alternating Background<br />Row & Column Headers<br />Design Time (Visual Studio and Blend)<br />Grouping<br />Frozen Columns<br />FrozenColumnCount<br />Column sorting, reordering and resizing<br />
  15. 15. WPF Calendar and DatePicker<br />Blackout Dates (DatePicker.BlackoutDates)<br />SelectionMode<br />SingleRange, SingleDate, MultipleRange, None<br />FirstDayOfWeek<br />DisplayDate<br />DisplayMode<br />Month, Year, Decade<br />Design time experience for both Blend and Visual Studio<br />
  16. 16. .NET Framework Client Profile 4.0<br />Deploy faster and easier<br />
  17. 17. Client Profile<br />What is…?<br />A Subset of .NET Framework 4.0<br />Optimized for client applications<br />Provides functionality for most client apps including<br />WPF<br />Windows Forms<br />WCF<br />Click Once<br />What does it enables…?<br />Faster deployments<br />Smaller Install Package (28 Mb)<br />
  18. 18. What is not in .NET Framework Client Profile<br />ASP.NET<br />Advanced Windows Communication Foundation (WCF) functionality<br />.NET Framework Data Provider for Oracle<br />MSBuild for compiling<br />
  19. 19. Targeting Client Profile<br />Use Visual Studio Project Templates<br />View/Change Target Framework<br />If Adding Ref to .NET 4.0 based assemblies (They should not be referring to non-client profile assemblies )<br />
  20. 20. Deploying .NET Framework Client Profile<br />Click Once<br />Use client profile as launch condition<br />Available as<br />Local Package and Web Package<br />Very small size<br />
  21. 21. Troubleshooting Targeting Errors<br />Common errors<br />the type or namespace name "name" does not exist in the namespace "namespace". (Are you missing an assembly reference?)<br />Type "typename" is not defined.<br />Could not resolve assembly "assembly". The assembly is not listed as part of the "profile" Profile.<br />Common Causes<br />You Have Referenced an Assembly That Is Not Included in the Client Profile<br />You Have Referenced a Project or Assembly That Targets a Different Version of the .NET Framework<br />You Have Re-Targeted a Project to a Different Version of the .NET Framework<br />
  22. 22. Windows 7<br />
  23. 23. WPF Taskbar Integration<br />Thumbnails buttons <br />Icon overlays <br />Progress bars <br />Jumplists<br />With XAML Support<br />
  24. 24. Thumbnail Buttons<br />System.Windows.Windows.TaskBarItemInfo<br />Namespace System.Windows.Shell<br />TaskBarItemInfo<br />TaskBarItemInfo.ThumbButtonsInfos<br />ThumbButtonInfoCollection<br />ThumbButtonInfo<br />Command & CommandTarget<br />DismissWhenClicked<br />ImageSource<br />Description<br />Only 1 TumbnailButtonInfoCollection<br />Only 7 ThumbButtonInfo<br />No Text only Image<br />
  25. 25. Overlay Icons<br />Must use images of type png<br />Have to be 16/16 pixels.<br />Set TaskBarItemInfo.Overlay to DrawingImage-> ImageDrawing<br />
  26. 26. XAML Improvements<br />New XAML API<br />System.Xaml.dll<br />Reduction in number of different XAML Parsers<br />
  27. 27. Silverlight Synergy<br />Improved Support for Developing Silverlight Applications<br />
  28. 28. Q.A.<br />
  29. 29. Thank you<br />Abhimanyu Singhal<br />Lead Consultant<br />http://www.imentor.co.in/blog<br />abhimanyu@imentor.co.in<br />iMentor Knowledge Services<br />

×