views:

199

answers:

1

I'm trying to use Tim Heuer's FloatableWindow control for a non-modal options window in my Silverlight application. However, I'm running into a problem with the FloatableWindow resizing it's parent grid when it opens. For example, before I open the window the application looks like this:

Screenshot of application before FloatableWindow is open

But after opening the window, the first row of the grid expands:

Screenshot of application after FloatableWindow is open

I'm currently setting FloatableWindow.ParentLayoutRoot to the LayoutRoot grid in MainPage.xaml. Is this the right thing to do? How can I prevent the grid from resizing when the FloatableWindow opens?

A: 

I ran into this too. Floatable window gets a bit lame if your grid is table based:

<Grid x:Name="LayoutRoot">
  <Grid.RowDefinitions>
  bla bla...
  </Grid.RowDefinitions>
<Grid.ColumnDefinitions>
  bla bla...
</Grid.ColumnDefinitions>

  more of your code bla bla...
</Grid>

The fix is very simple just add a dummy grid in there for your table based layout and just use 'LayoutRoot' like you did before.

<Grid x:Name="LayoutRoot">
  <Grid x:Name="DummyGrid">
    <Grid.RowDefinitions>
     bla bla...
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
     bla bla...
    </Grid.ColumnDefinitions>

    more of your code bla bla...
 </Grid>
</Grid>
Shnitzel