我有一个 Window1.xaml 主窗口;在某些事件之后,我显示了一个 UserControl EditFile.xaml。
后面的代码是:
public static int whichSelected = -1;
private void button1_Click(object sender, RoutedEventArgs e)
{
//searchEditPanel.Children.Clear();
whichSelected = listViewFiles.SelectedIndex;
searchEditPanel.Children.Add(_EditFileControle); //this is Grid
}
现在,如何通过单击取消按钮或类似的东西从其内容中关闭打开/添加的 UserControl?