Silverlight Feeds - All your Silverlight feeds in one place.

Sponsors

Thursday, October 09, 2008

Silverlight 2 Gotcha - Tab Navigation in a Popup, Take 2

by Jeff Handley via Jeff Handley on 10/9/2008 5:54:18 PM

After I posted about how to regain tab navigation in a popup, Ian commented that the workaround had some flaws.  First, he lost intellisense inside the <UserControl> and second, which is more painful, he could not refer to any controls inside the child <UserControl> from the page's code-behind.

Well, I found a more suitable workaround.  Instead of using a <UserControl> to set the TabNagation, you can use a <ContentControl> instead.  Here's the updated workaround code:

   1: <UserControl x:Class="PopupTabbing.Page"
   2:     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
   3:     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
   4:     Width="400" Height="300">
   5:     <Grid x:Name="LayoutRoot" Background="White">
   6:         <Popup IsOpen="True">
   7:             <Popup.Child>
   8:                 <ContentControl TabNavigation="Cycle">
   9:                     <StackPanel Width="150">
  10:                         <TextBlock Text="Username" />
  11:                         <TextBox x:Name="Username" />
  12:                         <TextBlock Text="Password" />
  13:                         <PasswordBox x:Name="Password" PasswordChanged="Password_PasswordChanged" />
  14:                         <Button Width="75" Content="Login" Click="Button_Click" />
  15:                     </StackPanel>
  16:                 </ContentControl>
  17:             </Popup.Child>
  18:         </Popup>
  19:     </Grid>
  20: </UserControl>


Thanks to Ian for pointing out the problems with the workaround!

email it!bookmark it!digg it!

Original Post: Silverlight 2 Gotcha - Tab Navigation in a Popup, Take 2

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. Silverlight Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on Silverlight Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us