有谁知道如何在 Outlook 加载项中使用 WPF,我已经阅读了一些博客文章,我意识到可以在 Outlook 加载项项目中添加 WPF 控件。我只想在 Outlook 加载项中托管一个完整的 WPF 应用程序。很简单,当单击 Outlook 功能区按钮时,它应该打开一个 WPF 应用程序,而不是 Windows 窗体中托管的 WPF 控制器,可以这样做吗?
编辑答案:
要在 Outlook 加载项项目中使用 WPF,首先将 WCF 用户控制器添加到项目中,并将 .XAML 文件和 .CS 文件中的“用户控制器”更改为“窗口”。然后你就完成了,你可以用 WCF 做任何你想做的事情。改变这个>>
<UserControl x:Class="AccessCachedContactsTest.UserControl2"
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="300" d:DesignWidth="300">
<Grid>
</Grid>
</UserControl>
到这里>>
<Window x:Class="AccessCachedContactsTest.UserControl2"
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="300" d:DesignWidth="300">
<Grid>
</Grid>
</Window>
并将 .xaml.cs 文件的根类更改为“Window”。