Close current UserControl
Posted
by BlueMan
on Stack Overflow
See other posts from Stack Overflow
or by BlueMan
Published on 2010-06-01T10:52:57Z
Indexed on
2010/06/01
11:33 UTC
Read the original article
Hit count: 242
I have a Window1.xaml main Window and after same event I display a UserControl EditFile.xaml
The code behind is:
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
}
And now, how to close the opened/added UserControl from it content by clicking Cancel button or something like that.
© Stack Overflow or respective owner