2010-03-12 32 views
2

我試圖使用Tim Heuer's FloatableWindow control在我的Silverlight應用程序的非模態窗口選項。但是,我打開FloatableWindow調整它的父網格時遇到問題。例如,在我打開窗口的應用程序是這樣的:FloatableWindow調整大小電網在Silverlight

Screenshot of application before FloatableWindow is open http://www.freeimagehosting.net/uploads/a71ab86e4b.png

但打開窗口後,網格的第一行展開:

Screenshot of application after FloatableWindow is open http://www.freeimagehosting.net/uploads/94d97c22ee.png

我目前將FloatableWindow.ParentLayoutRoot設置爲MainPage.xaml中的LayoutRoot網格。這是正確的事情嗎?如何防止FloatableWindow打開時調整網格大小?

回答

2

我也遇到過。如果您的網格表基於浮動窗口變得有點跛:

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

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

修復的方法是非常簡單隻需添加一個虛擬網格在那裏爲你的表 基於佈局,只需使用「LayoutRoot」像你以前那樣。

<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> 
相關問題