I am working on an Outlook 2010 add-in that provides a dialog box for user input. The code required to display the button on the ribbon is in the Outlook 2010 add-in's own project. This project has a link to the WPF user management library, which is responsible for the bulk of the work.
I use the static method in the WPF User Controls Library project, which is responsible for setting Caliburn.Micro correctly and displaying the dialog. All this works as expected, except that I cannot figure out how to properly position the dialog. I would like it to be displayed in the center of the Outlook window. I know that I have access to Microsoft.Office.Interop.Outlook.Application.ActiveWindow() , but I do not see how this helps me, since I can not translate it into PlacementTarget , as expected, in the settings of the Caliburn method .Micro WindowManager ShowDialog.
WPF Management Library
namespace WpfUserControlLibrary { public static class Connector { public static void ShowDialog() { new AppBootstrapper(); var windowManager = IoC.Get<IWindowManager>(); windowManager.ShowDialog( new ShellViewModel() ); } } }
Outlook 2010 Add-in
WpfUserControlLibrary.Connector.ShowDialog();
Megan source share