<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<StackPanel>
<TextBlock>请输入关键字:</TextBlock>
<TextBox Name="txtKeyWord"/>
<Button Content="搜索" HorizontalAlignment="Center" Click="OnSearch"/>
</StackPanel>
</Grid>
private void OnSearch(object sender, RoutedEventArgs e)
{
if (txtKeyWord.Text == "")
{
return;
}
SearchTask MySearch = new SearchTask();
MySearch.SearchQuery = txtKeyWord.Text;
MySearch.Show();
}