2014-12-22 2 views
0

MvvmCross를 사용하여 wpf 응용 프로그램을 개발 중입니다. 경고 창이있는 내 자신의 대화 상자 플러그인이 있습니다. 내 동작을 확인하기 위해 일부 버튼을 클릭하면 팝업이 표시됩니다. 이전에는 경고 창은 단순한 wpf 창이었습니다. 하지만 Mahapps를 사용하여 스타일을 지정하고 싶습니다. 내가 Mahapps의 MetroWindow에 창에서 AlertWindow의 기본 클래스를 변경 오류가 "어셈블리 플러그인 유형을 찾을 수 없습니다"발생했을 경우에플러그인 프로젝트에서 Mahapps를 사용할 수 없습니다.

문제가

다음은 XAML 파일 및 C# 파일 내 코드는

<Controls:MetroWindow x:Class="Test.MvvmCross.Plugins.Dialog.Wpf.AlertWindow" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" 
     Title="" Height="120" Width="350" SizeToContent="Height" ShowInTaskbar="False" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" > 
    <Window.Resources> 
     <ResourceDictionary> 
      <ResourceDictionary.MergedDictionaries> 
       <ResourceDictionary Source="pack://application:,,,/Test.MvvmCross.Plugins.Dialog.Wpf;component/Styles/Generic.xaml" /> 
      </ResourceDictionary.MergedDictionaries> 
     </ResourceDictionary> 
    </Window.Resources> 

    <StackPanel Orientation="Vertical"> 
     <TextBlock TextWrapping="Wrap" Margin="10" Text="{Binding Message}" Name="MessageTb">asdfasdf asdfasdf asdfa asdfas asdf asdf asdf</TextBlock> 
     <DockPanel Margin="5" Background="White"> 
      <Button DockPanel.Dock="Right" Margin="5" Height="30" Width="65" Name="NeutralButton" IsCancel="True"> 
       <Grid> 
        <ContentControl Style="{StaticResource Content1NormalButtonStyle}" > 
         <TextBlock Name="NeutralContent1Textblock" Foreground="{StaticResource ButtonNotSelectedColorBrush}"/> 
        </ContentControl> 
        <ContentControl Style="{StaticResource Content2NormalButtonStyle}" > 
         <TextBlock Name="NeutralContent2Textblock" Foreground="{StaticResource ButtonTextColorBrush}" FontWeight="Bold"/> 
        </ContentControl> 
       </Grid> 
      </Button> 
      <Button DockPanel.Dock="Right" Margin="5" Height="30" Width="65" Name="NegativeButton"> 
       <Grid> 
        <ContentControl Style="{StaticResource Content1NormalButtonStyle}" > 
         <TextBlock Name="NegativeContent1Textblock" Foreground="{StaticResource ButtonNotSelectedColorBrush}"/> 
        </ContentControl> 
        <ContentControl Style="{StaticResource Content2NormalButtonStyle}" > 
         <TextBlock Name="NegativeContent2Textblock" Foreground="{StaticResource ButtonTextColorBrush}" FontWeight="Bold"/> 
        </ContentControl> 
       </Grid> 
      </Button> 
      <Button DockPanel.Dock="Right" Margin="5" Height="30" Width="65" Name="PositiveButton" IsDefault="True" > 
       <Grid> 
        <ContentControl Style="{StaticResource Content1NormalButtonStyle}" > 
         <TextBlock Name="PositiveContent1Textblock" Foreground="{StaticResource ButtonNotSelectedColorBrush}"/> 
        </ContentControl> 
        <ContentControl Name="PositiveContent2" Style="{StaticResource Content2NormalButtonStyle}" > 
         <TextBlock Name="PositiveContent2Textblock" Foreground="{StaticResource ButtonTextColorBrush}" FontWeight="Bold"/> 
        </ContentControl> 
       </Grid> 
      </Button> 
      <Control /> 
     </DockPanel> 
    </StackPanel> 
</Controls:MetroWindow> 

이것은 오류 메시지 image입니다.

** 내가 XAML 코드 나는 문제없이 내 주요 프로젝트에 Mahapps을 사용했다

를 업데이트했습니다. 당신이 내가 원하는 것을 이해하지 못하면 저에게 알려주십시오.

+0

정확한 오류 메시지를 게시 할 수 있습니까? –

+1

여기서'Style' 리소스를 포함하고 있습니다. –

+0

@Matthew 귀하의 질문에 대해 확실하지 않습니다. 에 추가합니다. – user3432518

답변

1

내 문제의 해결책을 찾았습니다. MahApps의 버전입니다. ui 프로젝트는 플러그인 프로젝트보다 오래된 버전을 사용하기 때문입니다.

내가 같은 것으로 변경 한 후에는 모든 것이 정상입니다.

관련 문제