February CTP of WinFX Published — Breaking Changes


If you haven’t seen, the February CTP of WinFX is live.  Be sure to check out the release notes if you are having install/uninstall issues.


Below is an incomplete list of breaking changes:
 


1) The following XML namespace Uris are modified:
 


OLD


http://schemas.microsoft.com/winfx/avalon/2005


NEW


http://schemas.microsoft.com/winfx/2006/xaml/presentation


 


OLD


http://schemas.microsoft.com/winfx/xaml/2005


NEW


http://schemas.microsoft.com/winfx/2006/xaml


 


 


2) The syntax for mapping a CLR namespace to an XML namespace has changed. This is true for namespaces in the same assembly or different a different assembly.  A Mapping Processing Instruction is no longer necessary. 
 


Mapping PI for same assembly


OLD


<?Mapping XmlNamespace=”local” ClrNamespace=”MyCompany.MyProduct” ?>
<… xmlns:my=”local” >


NEW


<… xmlns:my=”clr-namespace:MyCompany.MyProduct” >


 


Mapping PI for different assembly


OLD


<?Mapping XmlNamespace=”local” ClrNamespace=”MyCompany.MyProduct” Assembly=”someDLL” ?>
<… xmlns:my=”local” >


NEW


<… xmlns:my=”clr-namespace:MyCompany.MyProduct;assembly=someDLL” >



For fully specified assembly names, follow the syntax outlined here: http://msdn2.microsoft.com/en-us/library/system.reflection.assemblyname.aspx



3) Specifying columns and rows in Grids is now stricter.


OLD


<Grid>
 <ColumnDefinition />
</Grid>.


NEW
<Grid>
  <ColumnDefinitions>
    <ColumnDefinition/>
  </ColumnDefinitions>
</Grid>



4) Increased strictness with databinding such that binding statements must be set using attribute syntax.


OLD
<TextBox.Text>{Binding}</TextBox.Text>


NEW
Text = “{Binding}”


5) System.Windows.Serialization is now System.Windows.Markup


6) UserControl has changed to be a ContentControl. The FixedTemplate property has beenremoved.


OLD


<UserControl>
 <UserControl.FixedTemplate>
    <Grid>
    </Grid>
 </UserControl.FixedTemplate>
</UserControl>


 


NEW
<UserControl>
  <Grid>
  </Grid>
</UserControl>


7) Removing MediaElement.Player property, and the player methods of MediaPlayer onto MediaElement. 


MediaElement myME;


OLD


myME.Player.Play();


NEW


myME.Play(); // new



8) Behavior change to media


In the Jan CTP, the following XAML would play the video file until the file ended, or until the MediaElement was GCd. 


<MediaElement Source=”a.wmv”>


A MediaElement now stops when it is Unloaded by default.


If MediaElement is incorporated into a visual that does not propagate OnLoaded and Unloaded events (such as VisualBrush), it won’t play automatically on Load. There are a number of work-around for this:


If you want to preserve the old behavior of MediaElement of starting to play at parse time rather than OnLoaded – <MediaElement Source=”foo” UnloadedBehavior=”Play”/>


If you want to use a Storyboard – <MediaElement UnloadedBehavior=”Manual”/>


If you want to use code-behind – <MediaElement UnloadedBehavior=”Manual”/>
 


9) In order to insert an XML data island into a XAML file, the XML source must be wrapped in an x:XData tag:
 


OLD


<XmlDataProvider x:Key=”aXmlDP”>


    <Root xmlns=””>


        <Number type=”int”>333</Number>


    </Root>


</XmlDataProvider>



NEW


<XmlDataProvider x:Key=”aXmlDP”>


    <x:XData>


        <Root xmlns=””>


            <Number type=”int”>333</Number>


        </Root>


    </x:XData>


</XmlDataProvider>


 11) VideoDrawing is broken in this build.


12) SinglePageViewer is now FlowDocumentPageViewer


12) The relative source binding syntax has changed


OLD


{Binding Path=foo, RelativeSource=/TemplatedParent}
NEW
{Binding Path=foo, RelativeSource='{RelativeSource TemplatedParent}’}


Comments (18)

  1. Tim Sneath vient de l’annoncer sur son blog : cette version est majeure car l’API est stabilis&#233;e et ne…

  2. Tim Sneath says:

    This is intended as a quick guide to the major breaking changes that will affect Windows Presentation…

  3. avalonboy says:

    Last night, I have installed the CTP February so, don’t panic if nothing works.

    After recompiling my…

  4. barry says:

    The GridViewColumnHeader property, "AssociatedColumn" has been changed to, simply, "Column."

  5. The February CTP of the runtime and development components for WinFX are now available. Realize that…

  6. jfo's coding says:

    Feb CTP is out.&amp;nbsp; This CTP, the Cider install is integrated into the Visual Studio &quot;Orcas&quot; Development…

  7. I’ve posted a minor release of the 3D Tools for the Windows Presentation Foundation which is built against…

  8. lexp says:

    When will WinFX be integrated and be NOT UNINSTALLABLE in Vista?

    In Feb CTP it is even not installed by default!

    You guys want us to develop WinFX apps and WinFX components are not present in default Vista package!

  9. Paria says:

    Can you please tell me what this error is all about?

    Unknown build error, ‘Could not load type ‘System.Windows.Serialization.XmlnsDefinitionAttribute’ from assembly ‘WindowsBase, Version=3.0.51116.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′.’ UIControls

    I have made all the changes mentioned on this posting!

    Thanks

  10. 1. MSDN上的ASP.NET《怎么做。。。》系列教学录像,包括缓存,定制登陆门户,Master Pages/Site Navigation/Membership/Roles/Profiles/Themes,Web…

  11. Tim Sneath vient de l&amp;#39;annoncer sur son blog : cette version est majeure car l&amp;#39;API est stabilis&amp;eacute;e