Execute code when a WPF closes

后端 未结 5 1160
悲&欢浪女
悲&欢浪女 2020-12-01 12:11

I am not familiar with using event handlers, and I was wondering if anyone had or could direct me to some code that shows how to use an event handler that will execute code

5条回答
  •  离开以前
    2020-12-01 13:00

    It's just this XAML

    
        ...
    
    

    and code for both the Closing and Closed events

    private void Window_Closing(object sender, CancelEventArgs e)
    {
        ...
    }
    
    private void Window_Closed(object sender, EventArgs e)
    {
        ....
    }
    

提交回复
热议问题