May 2007 - Posts

I've been working with Expression Blend, in creating XAML-based applications using the Windows Presentation Framework.  I wanted to start writing a few articles about the usages of some of the elements, such as the popup.  It seemed different to me, and after being directed to go to the Windows 6.0 SDK by a person on the MSDN forums, it isn't really that hard to use at all.  Here is my usage of it:

<Popup x:Name="StationSelector" PlacementTarget="{Binding ElementName = StationSelect}" PopupAnimation="Fade" AllowsTransparency="True">
    <Border HorizontalAlignment="Left" BorderThickness="2" Margin="10,10,0,0"
              BorderBrush="Navy" Background="LightYellow">
    <TextBlock TextWrapping="Wrap">Select a station</TextBlock>
    </Border>
</Popup> 

Notice some of the changes from normal programming in .NET 2.0.  You will see it is XML-based, and that certain attributes require a namespace (like x:Name to state the name of the control).  In addition, binding statements appear in {} and you can specify other XAML controls or providers in binding statements.  The PlacementTarget states the target control that the popup will appear at.

There are a variety of animation styles that you can use, such as flying in from the side, fading in/out, etc.  And, it supports placing elements within it, so you can add any of the WPF controls to it to provide more of an interface.  To show the popup, you need to use this code in the code-behind file:

this.StationSelector.IsOpen = true;
this.StationSelector.StaysOpen = false;

Alternatively, you can use a binding statement for the IsOpen property to link the value to another control, such as a checkbox's checked property.

Posted by bmains | with no comments
Filed under:
The leading UI suite for ASP.NET - Telerik radControls
Outstanding performance. Full ASP.NET AJAX support. Nearly codeless development.