Window1.xaml 메인 창이 있습니다. 어떤 이벤트가 발생하면 UserControl EditFile.xaml을 표시합니다.현재 UserControl 닫기
코드 뒤에 다음과 같습니다
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
}
그리고 지금은, 내가 어떻게 열/a를 그런 식으로 버튼을 누르거나 무엇인가를 취소를 클릭하여 컨텐츠에서 UserControl을 추가 닫을 수 있습니다?
예 - 작동하지만 부모 (Window1)에서 실행 중입니다. 내 자녀 (EditFile.xaml.cs 파일)에서 UserControl을 닫으려면 Cancel 버튼을 클릭해야합니다. – BlueMan