Grant Hinkson Blog

Silverlight, WPF, Fireworks, Flash, XAML, .NET, User Experience, Graphic Design, Web Programming and more!

Archive for the ‘WPF’ Category

Fireworks to XAML Converter Update

Tuesday
Apr 17,2007

Fireworks to XAML ExporterI’ve released an updated version of the Fireworks to XAML panel along with a new article at the Fireworks Developer Center at adobe.com. The article provides a nice overview of the panel, the features it offers, and how you can tailor the settings to meet your specific needs. The latest version includes a number of bug fixes, support for textures and patterns (ahh yeah!) and replaces the current masking implementation with clipping paths. You can download the latest version from the article posting.

The article is featured in the all new Fireworks Developer Center, updated along with the new CS3 launch. Fireworks CS3 has a ton of great new features that you definitely need to check out. There are lots of great new articles and walkthroughs in both the Developer Center and the Design Center.

Monday
Feb 26,2007
I’ve had a few people ask how to use the Reflection control in code-behind instead of purely through xaml, so I decided to post a quick example here. There’s not much to it, but it may not be obvious at first, so…First, create an instance of Reflector (either via XAML or procedurally). Below, I’m creating an instance named ref1. Next, set the ReflectionTarget property to the object you wish to reflect (in my case, a Rectangle named ‘rectangleToReflect’). That’s it! I have a little extra code to set the margin and alignment properties of ref1, then I add it to my outermost Grid, ‘LayoutRoot’.     

Are you using the Reflection control in any of your projects? If so, send me a link or a screenshot and I’ll post it here.

private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            // Create new Reflector object
            Reflector ref1 = new Reflector();
            // Set ReflectionTarget (the element to reflect)
            ref1.ReflectionTarget = rectangleToReflect;
            // Set a few layout properties
            ref1.Margin = new Thickness(50, 50, 0, 0);
            ref1.HorizontalAlignment = HorizontalAlignment.Left;
            ref1.VerticalAlignment = VerticalAlignment.Top;
            // Add reflection to LayoutRoot grid
            LayoutRoot.Children.Add(ref1);
        }

Download Reflection Sample Project

WPF Reflection Control

Sunday
Jan 14,2007

WPF Control on Blend StageReflectionTarget DataBindingMore Controls Dialog

I was considering some of the common things that people want to do when they first start working with WPF. Creating reflections is one of those things, and while it’s not terribly difficult to do, it does become a monotonous task. And what do you do when you find yourself doing the exact same thing over and over? You create a custom control of course!

The Reflector control exists to perform one task: simulate a reflection of an object. You just bind the ReflectionTarget property (found in the Appearances category in Blend) to another control and it does all the work for you. If you want to tweak the reflection, you can always edit the ControlTemplate in Blend, but the default settings should cover most cases. I’m also looking at the height and width of the target control, so if you set the height and width of the Reflector control to Auto, it will size itself automatically (in most cases).

Lee Brimelow just posted a tutorial called Reflections in Visual Studio and Blend
at ContentPresenter.com that shows how to manually create reflections. After watching that tutorial you’ll see what I’m taking care of automatically.

download WPF Reflection Control

(Note: Add a reference to this assembly in Blend by selecting the Project tab, right-clicking the References folder and selecting Add Reference. Browse to the assembly included in the zip file. Once you’ve added the reference, click the More Controls link on the tool menu (last item — double down arrows), and select the User Controls tab. You’ll see the Reflector control listed there.)

WPF/E and Flash Integration?

Wednesday
Dec 6,2006

Lee either gets no sleep, or has a lot more time for experimenting than I do. Check out this example where Flash and WPF/E live side by side and behave as one.

Monday
Dec 4,2006

Microsoft Expression BlendWow — lots of big updates available from Microsoft today. At the top of my list is Microsoft Expression Blend. This is the latest version of what was formerly known as Microsoft Expression Interactive Designer. Lots of “under the hood” changes have been made in this release, but the first thing that everyone will notice is the updated UI. Check out the Expression Blog for more details on the public beta. A new version of Expression Design is now also available for download. It has undergone the same UI treatment as Blend. It’s UI has actually been implemented using WPF, so you’ll see the same collapsible panels, styling and icons in both applications. I just fired up Design briefly, so I’ll post more thoughts once I’ve spent a little time using the tool.

In addition to the Expression releases, Microsoft has release the first CTP of “WPF/E”, which stands for Windows Presentation Foundation/Everywhere. Learn more via Mike Swanson’s post.

Meta


Recent Comments