3

Outlook アドインで WPF を使用する方法を知っている人はいますか? いくつかのブログ投稿を読み、Outlook アドイン プロジェクトに WPF コントロールを追加できることに気付きました。Outlook アドインで完全な WPF アプリケーションをホストしたいだけです。Outlook リボン ボタンをクリックすると簡単に、Windows フォームでホストされている WPF コントローラーではなく、WPF アプリケーションを開く必要があります。

編集された回答:

Outlook アドイン プロジェクトで WPF を使用するには、まず WCF ユーザー コントローラーをプロジェクトに追加し、.XAML ファイルと .CS ファイルの両方で "UserController" を "Window" に変更します。これで完了です。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>

また、.x​​aml.cs ファイルのルート クラスを "Window" に変更します。

4

1 に答える 1

8

Outlook アドイン プロジェクトで WPF を使用するには、まず WPF UserControl をプロジェクトに追加し、.XAML ファイルと .CS ファイルの両方で "UserControl" を "Window" に変更します。これで完了です。WPF で好きなことを行うことができます。これを変更 >>

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

また、.x​​aml.cs ファイルのルート クラスを "Window" に変更します。

于 2012-08-28T07:59:06.530 に答える