Published on
June 26, 2006 in
Avalon.
The June CTP of .Net Framework 3.0 was released on Friday. One new June CTP feature that I am very excited to introduce is a new property on Window called AllowsTransparency. AllowsTransparency enables you to create those semi-transparent windows and rounded-corner windows for which many of you have been asking.
I have written a small sample to illustrate some of the things to think about when creating semi-transparent windows. The central part of the sample is the following XAML:
<Window x:Class="WindowTransparency.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WindowTransparency" Height="300" Width="300"
AllowsTransparency="True" WindowStyle="None"
Background="Transparent"
>
<Border CornerRadius="50" Background="Blue" Opacity=".7">
<Button Click="CloseWindow" Height="30" Width="100">Close Me
</Button>
</Border>
</Window>
There are a few things to notice in this XAML. First is that I set Window.AllowsTransparency to true. Of course, as the name implies, this simply means that the Window may be made transparent (under the covers, it switches to using a layered window), it does not actually set the background to transparent. To achieve a transparent window, I set Window.Background to Transparent. Now that I have a transparent window surface, I can draw whatever content inside of it that I like. In this example, I’m simply using a Border with rounded corners to show that you can create rounded-corner windows and dialogs.
You’ll also notice that I have set Window.WindowStyle to None. For now, Windows with AllowsTransparency=true are not compatible with any of the other WindowStyles, and we expect that this will be fine for most scenarios (if you are using a transparent window, you probably don’t want the standard Win32 window chrome). Drawing your own Window chrome is easy (as an example, I’ve created a close button that I’ve hooked up to Window.Close()). Making your Window user-draggable is actually just as easy to do. The following code does it:
public Window1()
{
InitializeComponent();
MouseLeftButtonDown += new MouseButtonEventHandler
(Window1_MouseLeftButtonDown);
}
void Window1_MouseLeftButtonDown(object sender,
MouseButtonEventArgs e)
{
DragMove();
}

You can download the full sample here.
Published on
June 17, 2006 in
Family.
My little brother graduated from college today. Congrats Shawnie!
Published on
June 15, 2006 in
Avalon.
The Windows SDK online documentation is now live with Beta 2 content. The WPF content is under the WinFX node. My assumption is that that node will change to “.Net Framework 3.0″ at some point.
Published on
June 13, 2006 in
Avalon.
Here is a shot of about half of the WPF team members present at TechEd (they made me stand in front because I’m short). I’ll try to snag another this week with everyone.
Published on
June 12, 2006 in
Avalon.
Unfortunately the chalk talk schedule is not provided in any of the printed TechEd materials, but we on the WPF team are resourceful folks, and we put together this high-tech alternative:
Our demo booth is a bit hidden, so it may be hard to find by the signage, but you can always just look for our bright orange shirts over in the Developer area.
Published on
June 12, 2006 in
Avalon.
The brand new WPF community website is live! Check out the aggregate feed for WPF blogs, another feed for forum posts, a sample gallery (you can download samples or post your own), and news and announcements about WPF. We hope that this will be a great resource for WPF developers and designers, and we’d love your feedback on it.
Published on
June 11, 2006 in
Avalon.
Here’s a cheat sheet if you want to attend all of the WPF talks at TechEd:
| Date |
Time |
Code |
Title |
Speaker |
| Mon 6/12 |
9:00am-10:15am |
DEV 202 |
WPF: Introduction |
Rob Relyea |
| Mon 6/12 |
5:00pm-6:15pm |
DEVTLC 05 |
WPF: Interop with Win32 and MFC |
Nick Kramer |
| Tue 6/13 |
2:45pm-4:00pm |
DEVTLC 09 |
WPF: Data Visualization |
Kevin Moore, Beatriz Costa, & Robert Ingebretsen |
| Tue 6/13 |
4:30pm-5:45pm |
DEVTLC 10 |
WPF: XAML Browser Applications and the Partial Trust Sandbox |
Karen Corby & Ashish Shetty |
| Wed 6/14 |
10:15am-11:30am |
DEV 326 |
WPF: Building Rich Content Experiences with Windows Presentation Foundation |
Chris Han |
| Thu 6/15 |
9:45am-11:00am |
DEV 336 |
WPF: Creating Windows and Web Applications with WPF |
Lauren Lavoie |
| Thu 6/15 |
1:00pm-2:15pm |
DEV 338 |
WPF: Building Data-Driven Applications with Windows Presentation Foundation |
Kevin Moore |
| Fri 6/16 |
2:45pm-4:00pm |
DEV 349 |
WPF: Build Beautiful Applications with Windows Presentation Foundation |
Robert Ingebretsen |
There are going to be three chalk talks covering WPF content as well (one on data visualization, one on writing XBAPs, and one on interop). I will update this post with the schedule for those talks when I know it.
Update 6/12/2006 7:47am (PDT): Added the chalk talks to the table above.
Published on
June 11, 2006 in
Avalon.
TechEd 2006 began tonight in Boston with a keynote featuring Bob Muglia and Chris Capossela. There was a lot of energy in the room, and a set of very cool videos spoofing the show “24″ (which seemed to be filmed primarily inside of the Seattle Library!)
I’ll be working the Windows Presentation Foundation demo station and labs throughout the week, so please stop by and say hello. I’ll be giving a talk on Thursday morning at 9:45 discussing application model stuff, and how to build applications for both Windows and the Web.
Details for my talk are as follows:
DEV336 – (WinFX) Windows Presentation Foundation: Creating Windows and Web Applications with WPF
Learn how to use Windows Presentation Foundation application-level primitives for data management, system interaction, hosting, and UI to create great client applications. See how to create both standalone client applications and rich browser applications that can take advantage of these services. Gain knowledge that will help you make application-level decisions, such as when your application should be hosted in the browser or a standalone window, whether or not to write a navigation-based application, and how to manage application data and settings for various scenarios.
Timeslot: 6/15/2006 9:45 – 11:00
I hope to see you there!
Published on
June 7, 2006 in
Avalon.
Here’s a list of a few WPF samples that I want to write soon (in no particular order):
- Building a FileUpload control
- Removing/restyling the NavigationWindow UI
- Displaying HTML inside of your WPF application
- Using URL arguments to enable “deep linking” for XBAPs
- Using Popup as a dialog in XBAPs
I’m posting the list here so that I don’t forget. :) But also, if you have any feedback — e.g. you really want to see the NavigationWindow UI sample before the HTML sample or there’s some other application model-oriented sample that you want to see before any of these — please let me know.
I won’t get to these until after TechEd Boston (next week!), but if you are blocked on any WPF questions in the meantime, feel free to contact me (as usual).