Thursday, December 31, 2009

WPF 24 Review

  • Technical Features
    • XAML
    • Template
      • Control Template (define a control looks)
      • Data Template (define the way certain types of data are rendered)
    • Binding :
      • Data Binding
      • …..
    • Styling (like css in html)
    • Triggers
    • Animation (2D and 3D)
  • Three Types
    • XBAP
    • ….
  • Silver Light and WPF
    • SL use xaml as well
    • SL is hosted in browser and is cross-platform
    • SL(2.0) can not support all features of WPF
  • Application Layout (base calss :System.Windows. FrameworkElement)
    • Dockpanel
      • Attached Properties
    • Stackpanel
      • WrapPanel(special Stackpanel with wrap feature)
    • Grid
      • column and row definition
      • * means average space
      • auto means space is decided by system
    • Canvas
    • Decorator:add graphical decoration or behavior to other
      elements
      • Borders
  • Design tips
    • Set focus : FocusManager.FocusedElement=”{Binding ElementName=firstName}”
    • Add keyboard shortcut for a button : AccessText
  • Dependency Property
  • Binding
    • TextBlock Text=”{Binding ElementName=SampleText , Path=Text}”  // sampleText is another textbox control
    • Listbox ItemsSource=”{x:Static Fonts.SystemFontFamilies}”
    • Can be twoway based : TextBox Text=”{Binding ElementName=mySlider,Path=Value,Mode=TwoWay}” />
    • DataContext in FrameworkElement : inheritance
      • <ListBox x:Name=”FontList” DataContext=”{x:Static Fonts.SystemFontFamilies}” ItemsSource=”{Binding}”

0 Comments:

Post a Comment

<< Home