none
reopen a closed WPF on a microsoft outlook addin c# RRS feed

  • Question

  • i've a WPF openned from a button in the ribbon of Microsoft Outlook, for an addin i'm developing.

    private void _HandlerUserSettings(Office.CommandBarButton ctrl, ref bool cancel)
    {
        var windowUserSettings = new WpfUserSettings();
        windowUserSettings.Show();
    }

    if i close the WPF from its close button, if i click again the button to handle the show of the window, it doesn't work. i guess the close action does something more than a simple Hide, so my goal is to override the closing action. i tried to work on Closing method WpfUserSettings_Window_Closing of my xaml window:

    <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>

    do you have any suggestions or howto to read, that i didn't find? thank you


    • Edited by silversonicaxel Thursday, September 26, 2013 5:31 PM better expression
    Thursday, September 26, 2013 4:19 PM