这是 XAML。两个问题。首次打开窗口时,底部的 2 个按钮都被切掉,右侧的“Save_Search”按钮也被切掉。第二个问题是,当我调整窗口大小时,列表视图会像我预期的那样变长,但按钮都最终位于列表视图的中间,而不是相对于窗口边框移动。当我搜索这个时,没有太多。
Title="Queries" Height="274" Width="540">
<DockPanel Height="Auto" HorizontalAlignment="Stretch" Name="dockPanel1" VerticalAlignment="Stretch" Width="Auto">
<Grid Height="Auto" Width="Auto" Margin="0,0,0,0">
<TextBox Height="27" HorizontalAlignment="Left" Margin="256,6,0,0" Name="SearchTermsTextBox" VerticalAlignment="Top" Width="227"
Text="Enter search terms separated by `;`"/>
<ListView Name="ResultsListView" Margin="6,41,13,48" ItemsSource="{Binding}" Width="auto">
<ListView.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock FontSize="15" FontWeight="Bold" Text="{Binding Name}"/>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</ListView.GroupStyle>
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Width" Value="Auto" />
<Setter Property="FontSize" Value="10.4" />
</Style>
</ListView.ItemContainerStyle>
</ListView>
<Button Content="Save Search" Margin="425,203,12.6,17.6" Name="Save_Search" Width="96" Height="25" />
<Button Name="Query_Button" Content="Ports" Margin="310,203,127.6,0" Height="25" Width="96" VerticalAlignment="Top"></Button>
</Grid>
</DockPanel>