FloatableWindow resizes Grid in Silverlight
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开发者_如何学C is open http://www.freeimagehosting.net/uploads/a71ab86e4b.png
But after opening the window, the first row of the grid expands:
Screenshot of application after FloatableWindow is open http://www.freeimagehosting.net/uploads/94d97c22ee.png
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?
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>
精彩评论