WPF Major Breaking Changes in Feb 2006 CTP

WPF Major Breaking Changes in Feb 2006 CTP

  • Comments 9

This is intended as a quick guide to the major breaking changes that will affect Windows Presentation Foundation applications, rather than providing an exhaustive list:

  • Schemas have changed for WPF and XAML. Instead of:
    http://schemas.microsoft.com/winfx/avalon/2005
    use:
    http://schemas.microsoft.com/winfx/2006/xaml/presentation
    Instead of:
    http://schemas.microsoft.com/winfx/xaml/2005
    use:
    http://schemas.microsoft.com/winfx/2006/xaml
  • We've tightened up the definition of Grids - make sure you wrap ColumnDefinition and RowDefinition elements within a corresponding Grid.ColumnDefinitions or Grid.RowDefinitions element. (Previously you couldn't use this syntax within templates.)
  • SinglePageViewer is now FlowDocumentPageViewer (this makes sense, since the viewer is used for FlowDocuments!)
  • The relative source binding syntax has changed: replace
    {Binding Path=foo, RelativeSource=/TemplatedParent}
    with
    {Binding Path=foo, RelativeSource='{RelativeSource TemplatedParent}'}

UPDATE: Karsten and I are less well synchronized than normal this week since we're temporarily in different continents. He's posted a separate list of breaking changes on his blog. Check both locations out - he's got a few that I don't have and vice versa.

UPDATE 2: Rob has a nice tool that makes some of these updates automatically. He also mentions the external assembly referencing breaking change (another one I missed - doh!)

  • So these are the breaking changes.

    What kinds of non-breaking changes are in the Feb CTP?

    Im thinking in particular of WPF changes.
  • New features, you mean? I can't think of any further additions off-hand - we're really locked and loaded for RTM at this point.
  • I'm more curious about what other breaking changes there are.
  • Is Feb'2006 CTP of Avalon/WPF feature complete?

    thanks,
    Slavo.
  • Feb CTP is out.  This CTP, the Cider install is integrated into the Visual Studio "Orcas" Development...
  • How to use RelativeSource for ParentData
    as previously we use

    {Binding Path=foo, RelativeSource=/ParentData}
    But now there are four options

    1. Self  2. TemplatedParent 3. PreviousData 4.FindAncestor

    I think FindAncestor is good option in place of ParentData
    but it didn't work
    as i use AncestorType is required if FindAncestor

    <Binding Path="Data">
          <Binding.RelativeSource>
              <RelativeSource Mode="FindAncestor"
                        AncestorType="{x:Type StackPanel}">
              </RelativeSource>
         </Binding.RelativeSource>
    </Binding>

    its not working. Any Idea?
  • How do you translate

     {Binding RelativeSource=/TemplatedParent/TemplatedParent}

    into the new syntax for RelativeSource?

    I tried using
     {Binding RelativeSource={RelativeSource Mode=TemplatedParent, AncestorLevel=2}}

    But it doesn't work.
  • George,
    The following should work:
    {Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplatedParent}
  • any idea why this doesn't work?

    <Window x:Class="TemplateExample.Window1"

       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

       Title="TemplateExample" Height="300" Width="300"

       >

     <Window.Resources>

       <XmlDataProvider x:Key="Index" XPath="/Chapters">

         <x:XData>

           <Chapters xmlns="">

             <Chapter>

               <Title>Title 1</Title>

               <Name>Name 1</Name>

             </Chapter>

             <Chapter>

               <Title>Title 2</Title>

               <Name>Name 2</Name>

             </Chapter>

           </Chapters>

         </x:XData>

       </XmlDataProvider>

       <DataTemplate x:Key="MyTemplate">

         <StackPanel>

           <TextBox FontSize="14" FontWeight="Bold" FontStyle="Oblique" Text="{Binding XPath=Title}" />

           <TextBox FontSize="14" FontWeight="Bold" FontStyle="Italic" Text="{Binding XPath=Name}" />

         </StackPanel>

       </DataTemplate>

     </Window.Resources>

     <StackPanel>

       <ListBox Background="Aqua"

                ItemsSource="{Binding Source={StaticResource Index}, Path=Chapter}"

                ItemTemplate="{StaticResource MyTemplate}" />

     </StackPanel>

    </Window>

Page 1 of 1 (9 items)