2016-11-18 8 views
2

私は、Visual Studio Image Service and Catalogのこの概念を実験するための非常に単純なWPFアプリケーションを作成しようとしています。Microsoft.VisualStudio.Imaging.CrispImageに何も表示されないのはなぜですか?

既知の画像(KnownMonikersを使用して)をWPFデザイナーの両方で表示することができない、またはアプリが実行されているように見えない理由がわかりません。

画像があります。それは何も表示されません。

The image inside a border in the VS designer

enter image description here

ここでWPFのソースコードは、(上記のMSDNのリンクに説明を正確に手順を以下)です。

<Window x:Class="ImageCatalogBrowser.MainWindow" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:local="clr-namespace:ImageCatalogBrowser" 
     xmlns:imaging="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.Imaging" 
     xmlns:theming="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Imaging" 
     xmlns:utilities="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Utilities" 
     xmlns:catalog="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.ImageCatalog" 
     mc:Ignorable="d" 
     Title="MainWindow" Height="350" Width="525"> 
    <Window.Resources> 
     <utilities:BrushToColorConverter x:Key="BrushToColorConverter"/> 
    </Window.Resources> 
    <Grid> 
     <StackPanel 
      Background="White" 
      VerticalAlignment="Center" 
      theming:ImageThemingUtilities.ImageBackgroundColor="{Binding Background, RelativeSource={RelativeSource Self}, Converter={StaticResource BrushToColorConverter}}"> 
      <Border BorderThickness="1" BorderBrush="Black" Width="33" Height="33"> 
       <imaging:CrispImage 
        x:Name="crisp" 
        Visibility="Visible" 
        Width="32" 
        Height="32" 
        Moniker="{x:Static catalog:KnownMonikers.Save}" /> 
      </Border> 
     </StackPanel> 
    </Grid> 
</Window> 

誰も助けてくださいことはできますか?

答えて

0

ImageLibraryを初期化するためのコードビハインドは何ですか?ライブラリが要求しているモニカを見つけられない場合、画像は表示されません。

ImageLibraryを初期化するときに、ImageCatalogの.imagemanifestファイル(VSインストールディレクトリ内)へのパスを指定してください。

関連する問題