我有一个从 Microsoft Outlook 功能区中的按钮打开的 WPF,用于我正在开发的插件。
private void _HandlerUserSettings(Office.CommandBarButton ctrl, ref bool cancel)
{
    var windowUserSettings = new WpfUserSettings();
    windowUserSettings.Show();
}
如果我从其关闭按钮关闭 WPF,如果我再次单击该按钮来处理窗口的显示,它就不起作用。我想关闭动作不仅仅是一个简单的隐藏,所以我的目标是覆盖关闭动作。我尝试使用我的 xaml 窗口的关闭方法 *WpfUserSettings_Window_Closing*:
<Window x:Class="TrainingForgeOutlookAddin.View.WpfUserSettings"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        mc:Ignorable="d" 
        d:DesignHeight="350" d:DesignWidth="700" Title="User Settings"
        WindowStartupLocation="CenterScreen" Loaded="WpfUserSettings_OnLoaded"
        Closing="WpfUserSettings_Window_Closing">
 ....
</Window>
你有什么建议或如何阅读,我没有找到吗?谢谢你