VS 2010 and .NET Framework 4.0 Beta1 are out now!


As many of you probably already know, dev10 beta1 is available for public download.  Some of the additions to Beta1 on the WPF Controls side include:


·         MultiTouch


·         EasingFunctions for animations


·         DataGrid, Calendar, DatePicker, and VisualStateManager in PresentationFramework.dll


·         New APIs to support the control local values bug


·         And tons of bug fixes on the new controls as well as existing control and element services areas


I’ll be going over some of these new features in more depth so stay tuned!

Comments (4)

  1. Patrick says:

    I have been using the WPF Toolkit datagrid and have now started to use the .NET Framework 4 DataGrid in VS2010. Previously I used the Generic.xaml in my custom DataGrid from the supplied Toolkit source code. Where can I find the Generic.xaml file for the VS2010 implementation?

  2. vinsibal says:

    Patrick,

    Unfortunately there isn’t a Generic.xaml file that is available publically for the framework controls.  It is a nice thing to have in the toolkit.  There is a way you can get access to the default style programmatically.  Note that this is an internal method and undocumented so this can change in the future.

    Here is some example code for retrieving the default style of a button.  This can obviously be replaced with any control.

    Button b = new Button();

    Assembly asm = Assembly.GetAssembly(typeof(Button));

    Type styleHelperType = asm.GetType("System.Windows.StyleHelper");

    Style style = (Style)styleHelperType.InvokeMember(

                   "GetThemeStyle",

                   BindingFlags.NonPublic | BindingFlags.InvokeMethod | BindingFlags.Static,

                   null,

                   null,

                   new object[] { b, null });

    var settings = new XmlWriterSettings();

    settings.Indent = true;

    var sb = new StringBuilder();

    var writer = XmlWriter.Create(sb, settings);

    XamlWriter.Save(style, writer);

    MessageBox.Show(sb.ToString());

  3. Patrick says:

    Thank you very much for the help, it has got me the information I wanted. I understand that parts may change in the future (and most probably will). I will try to keep an eye out for that and cater for that possibility.

    PS I’m sure I’ve seen similar approaches to this before, but maybe not quite the same. I need to learn a bit more about .NET in this area!