我正在使用嵌套網格。在主網格中我有兩個單選按鈕,而在第二個時,我有兩個額外的單選按鈕和其他控件。WPF上嵌套網格問題
我希望總網格將包含3行和3列。
相關的代碼是:
<xctk:WizardPage Name="Page3" PageType="Interior"
Title="Stages"
Background="#FF27E0E0">
<xctk:WizardPage.CanSelectNextPage>
<MultiBinding Converter="{StaticResource NextFromPage3}">
<Binding ElementName="HR" Path="IsChecked" Mode="OneWay"/>
<Binding ElementName="LR" Path="IsChecked" Mode="OneWay"/>
<Binding ElementName="yes" Path="IsChecked" Mode="OneWay"/>
<Binding ElementName="no" Path="IsChecked" Mode="OneWay"/>
</MultiBinding>
</xctk:WizardPage.CanSelectNextPage>
<Grid ShowGridLines="True" Margin="-5 -10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label x:Name="qual" Content="Select Quality:" FontSize="13.333" Margin="5 10" VerticalAlignment="Top" HorizontalAlignment="Left"/>
<RadioButton x:Name="HR" Content="High-Resolution" FontSize="13.333" Grid.Column="1" Margin="5 10" VerticalAlignment="Top"/>
<RadioButton x:Name="LR" FontSize="13.333" Content="Low-Resolution" Grid.Column="2" Margin="5 10" VerticalAlignment="Top"/>
<Grid Grid.Row="1">
<Grid.Visibility>
<MultiBinding Converter="{StaticResource FilterConverter}">
<Binding ElementName ="HR" Path="IsChecked" Mode="OneWay"/>
<Binding ElementName ="LR" Path="IsChecked" Mode="OneWay"/>
</MultiBinding>
</Grid.Visibility>
<Label x:Name="symbol" Content="Select Symbol:" Grid.Row ="1" Grid.Column="0" FontSize="13.333" Margin="5 10" VerticalAlignment="Top" HorizontalAlignment="Left"/>
<ComboBox x:Name="symbolsCmbBox" FontSize="13.333" Grid.Row="1" Grid.Column="1" Margin="5 10" VerticalAlignment="Top" HorizontalAlignment="Left" ItemTemplate="{StaticResource cmbTemplate}" IsSynchronizedWithCurrentItem="True" SelectedIndex="0">
<ComboBox.ItemsSource>
<MultiBinding Converter="{StaticResource SymbolComboboxItemsFilter}">
<Binding ElementName ="HR" Path="IsChecked" Mode="OneWay"/>
<Binding ElementName ="LR" Path="IsChecked" Mode="OneWay"/>
</MultiBinding>
</ComboBox.ItemsSource>
</ComboBox>
<Label x:Name="isExists" Content="Select Yes if process will perform:" Grid.Row ="2" FontSize="13.333" Margin="5 10" VerticalAlignment="Top" HorizontalAlignment="Left"/>
<RadioButton x:Name="yes" Content="Yes" FontSize="13.333" Grid.Row="2" Grid.Column="1" Margin="5 10" VerticalAlignment="Top"/>
<RadioButton x:Name="no" Content="No" FontSize="13.333" Grid.Row="2" Grid.Column="2" Margin="5 10" VerticalAlignment="Top"/>
</Grid>
</Grid>
上面的代碼是上WPF工具包是否存在嚮導的一部分。 我的問題與嵌套網格上方該控件不位於預期位置。 雖然我只使用一個主網架,這個問題沒有發生,但我需要從其他原因嵌套格..
編輯,第一個答案: 我想,主要的電網將是第一線(3列),內部網格將從第二行開始,將包含總共兩行(3列),所以如何指定它?
EDIT-用於第二答案:
第一行(主網格)不是直的與第二和第三行(內網格) - 好像主電網的兩個無線電按鈕僅定位在列= 2上,即使它看起來不是來自xaml代碼。現在我的代碼就像下面第二個答案中出現的一樣。
感謝您的諮詢!
我編輯question-我想,主要的電網將成爲第一行(3列)和內網將從第二行開始並將包含總共兩行(3列),所以如何指定它? – Programmer