Jaime Rodriguez On Windows Store apps, Windows Phone, HTML and XAML
This post is a quick recap of the most important changes for WPF and Silverlight developers in this Beta 2 release. I definitely will return to a few of these topics over the next few weeks, so stay tuned for updates and new posts. Please note that this post is NOT all-inclusive; there are lots of features and smaller bug fixes that I am leaving out. I will try to dig those up as we go along in the next few weeks!
Also, I've listed links to the Beta 1 posts at the bottom of the post for those needing a refresh. I've also sprinkled links to the videos in our “WPF in VS2010 Beta 2 series” throughout the post, as well as listing them at the end.
New in the Visual Studio 2010 Cider designer
You can see a video with most of the Beta 2 updates in this 14 minute video with Mark Wilson Thomas. In the video, Mark shares a MUST USE registry key to improve the performance of Visual Studio 2010 Beta 2. For the record, this is in the readme, it is not a hack and Mark has documented it on his announcement:
Registry Switch for improved performance Because of a late-breaking change, you will need to make a configuration change to see the best designer performance. This configuration change will not be necessary in the final released versions of the product. NOTE: Editing the registry can cause serious problems that may require you to reinstall Windows. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. Refer to the article on registry editing for your OS (e.g http://support.microsoft.com/kb/136393) for advice. 1. Close any open VS instances 2. Open RegEdit (as an administrator as needed) 3. Select the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0 key 4. Right click and add key, type ClrHost 5. In the newly created key, right click and add a DWORD32 with the name StartupFlags 6. Set its value to 5 7. Close RegEdit 8. Start up Visual Studio and use as normal
[10/28 update. Mark now has a disclaimer and it is in bold red on his page, so it must be important, go read it:
Here are my cliff-notes from the video: For WPF developers
For Silverlight developers,
New Graphics (minus text) features for the WPF run-time? You can watch demos for most of these in this video with David Teitlebaum. You can get the demos for this video here.
New Text Features You can watch most of these improvements with insightful explanations in this Channel9 video with Chipalo Street.
New Control & Data binding features
New Windows 7 features
Deployment update You can watch a demo and get the whole picture from this Channel 9 video interview with Jossef Goldberg.
Hopefully this gets you caught up on beta2. Time to play! Download visual Studio 2008 beta2. Stay tuned for a few more posts on the topics above.
LINK ROLL!!
Beta 2 links:
Beta 1 (but still relevant links)
We recently announced a free, all-day Windows 7 developer training the day before PDC. Our goal for the day is to dive deep into the new most important kernel features, and also give you insightful advise into the new user mode developer features – including multitouch, taskbar, sensors & location, and graphics. The day will be packed with insightful advise guaranteed to save you hours of reading articles, documentation, and blog posts. We are going to be punchy and direct!
I am also pleased to announced that the MVPs attending PDC are joining us for the day, and are going to be hosting all the attendees for lunch; the lunch tables will have signs announcing the MVP technology to be discussed at that table; you can drill down on that specialty and connect with our community champions and most valuable professionals.
We are also adding to the boot camp the judging competition for the Code 7 contest; this will be a fun 30 minutes near the end of the day, you will see some very cool, inspiring Windows 7 projects developed by the community, and we will also have a few prizes to raffle for the boot camp attendees. If you are still not ready to go home after all that, you can hit the recently announced screening of the Visual Studio Documentary.
As you can see, the day is packed with great content, experts, and fun activities. All of this for the low price of FREE!! You do still have to register. All the details for the free registration are here. You do not have to be attending PDC, you can register for just the boot camp. Of course, if you are coming to LA, might as well stay for the full PDC. Registration to the boot camp is on first-come-first-served basis, so don’t wait too long. About the agenda for the day, it is the same schedule than the workshops: 10 AM to 5:45 PM with lunch at noon and two breaks during the day.
Our current outline divides the day into three two-hour sessions:
Again, must register to attend.. Don’t wait too long or you might be left out.
A few follow-up questions (and answers) from this post on Aero shake in WPF Windowless apps .
The code I posted does not work if your WPF WindowStyle=None window is maximized. Why is that?
The shell detects the shake based on Windows movement, and when a window is maximized, it can not be dragged. This is a behavior defined by the shell :(
Can’t you just ‘detect’ mouse move events and identify the shake gesture and then call the Shell’s API to do the shake?
Unfortunately not. The shell does not publicly expose APIs to implement the shake behavior – which is minimizing all windows except for the one that is being shaken-.
Are we out of luck then to get Aero Shake on a ‘full screen’ app?
I think that simulating shake (several posts on the web that do that) is not ideal. Those posts do it to bring Shake to earlier versions of Windows that do not have it. What I advised the person that did it was to not maximize their Window. You can detect the available screen real-estate and size to that. this.Width = SystemParameters.FullPrimaryScreenWidth; this.Height = SystemParameters.FullPrimaryScreenHeight + SystemParameters.CaptionHeight; this.ResizeMode = ResizeMode.NoResize; To most users (who are not looking to shake), the window will still look like it is maximized. No difference. To a user that is looking to shake, the window can be moved (and shaked). The mere idea of ‘shaking’ a full screen window is not very common, but in this case the app was partially transparent so it did need it. All I did was allow the shake again using DragMove, and then resetting the position of the window back to 0,0 after the shake. private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { this.DragMove(); this.Left = 0; this.Top = 0; } I am not claiming this is a best practice, but it worked good enough for my expectations. If you want to see the code and decide if it works for your scenario, you can download a sample app from here.
I think that simulating shake (several posts on the web that do that) is not ideal. Those posts do it to bring Shake to earlier versions of Windows that do not have it. What I advised the person that did it was to not maximize their Window. You can detect the available screen real-estate and size to that.
this.Width = SystemParameters.FullPrimaryScreenWidth; this.Height = SystemParameters.FullPrimaryScreenHeight + SystemParameters.CaptionHeight; this.ResizeMode = ResizeMode.NoResize;
To most users (who are not looking to shake), the window will still look like it is maximized. No difference. To a user that is looking to shake, the window can be moved (and shaked). The mere idea of ‘shaking’ a full screen window is not very common, but in this case the app was partially transparent so it did need it. All I did was allow the shake again using DragMove, and then resetting the position of the window back to 0,0 after the shake.
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { this.DragMove(); this.Left = 0; this.Top = 0; }
I am not claiming this is a best practice, but it worked good enough for my expectations. If you want to see the code and decide if it works for your scenario, you can download a sample app from here.
Why the emphasis on WindowStyle=None, does Aero Shake work on WPF apps with standard windows?
Aero Shake works fine with standard WPF windows; no changes are needed to your WPF apps. It is the windowless apps that needed the few lines I have shared in these posts.
At last, if you do not know what Aero Shake is, you can watch shake in action in this 15 seconds video.
I just tried to implement Aero Shake in a WindowStyle=None WPF window.
I had no clue what I would need to do; I figured I had to start by dragging the Window.. tried that, ran it just to see what would happen and voila! Windows 7 did the rest…
I am going to the movies (since I had budgeted 3 hours for this).. Thanks Windows 7 Shell team!
<Window x:Class="WpfApplication40.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" MouseLeftButtonDown="Window_MouseLeftButtonDown" Opacity="0.5" WindowStyle="None" AllowsTransparency="True" > <Grid> <TextBlock Text="Shake me.. please" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="60"/> </Grid></Window>
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { this.DragMove(); }
Windows 7 is packed with lots of new “developer” or “platform” features.
We are confident most customers would benefit (better per, better UX) from running on Windows 7; but we also acknowledge that adopting a new OS is not always immediate (specially for any large enterprise that recently rolled out Windows Vista).
For developers whose customers can’t move to Windows 7 immediately, Microsoft recently announced the “Platform update for Windows Vista” beta. The Platform Update for Windows Vista, brings a lot of the Windows 7 goodness into previous OSes (Windows Vista and Windows Server 2008); the update includes Direct2D, Direct3D, DirectCompute, Windows Imaging Component (WIC), DirectWrite, XPS , and the Windows Ribbon) .
You can learn a lot more about the Platform Update here.
Enjoy!