2010-02-19 4 views
-1

주 응용 프로그램 (Application.xaml)에 리소스를 추가하면 한 리소스 (DesignerItem.xaml)에 오류가 있음을 알리기 때문에 내 디자인 뷰어가로드되지 않습니다. . 그렇지 않으면 런타임에 완벽하게 작동합니다.xaml 디자이너 뷰어가로드되지 않습니다.

Application.xaml :

<Application xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"       
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
         x:Class="GesHoras.App" 
         StartupUri="WinMain.xaml"> 

    <Application.Resources> 
     <ResourceDictionary> 
      <ResourceDictionary.MergedDictionaries> 
       <!--Vista Theme --> 
       <ResourceDictionary Source="pack://application:,,,/PresentationFramework.Aero;V3.0.0.0;31bf3856ad364e35;component/themes/aero.normalcolor.xaml" /> 


       <ResourceDictionary Source="Themes/TabControl.xaml"/> 
       <ResourceDictionary Source="Themes/TabItem.xaml"/> 
       <ResourceDictionary Source="Themes/GridView.xaml"/> 
       <ResourceDictionary Source="Themes/ListView.xaml"/> 
       <ResourceDictionary Source="Themes/Button.xaml"/> 
       <ResourceDictionary Source="Themes/RepeatButton.xaml"/> 
       <ResourceDictionary Source="Themes/GroupBox.xaml"/> 
       <ResourceDictionary Source="Themes/TextBox.xaml"/>    
       <ResourceDictionary Source="Themes/ComboBox.xaml"/> 
       <ResourceDictionary Source="Themes/TreeView.xaml"/> 
       <!--<ResourceDictionary Source="Themes/Menu.xaml"/>--> 
       <ResourceDictionary Source="Themes/ProgressBar.xaml"/> 
       <ResourceDictionary Source="Themes/ToolTip.xaml"/> 

       <ResourceDictionary Source="Designer_Controls/DesignerItem.xaml"/> 
      </ResourceDictionary.MergedDictionaries> 
     </ResourceDictionary> 

    </Application.Resources> 

</Application>      

내 DesignerItem.xaml :

<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:s="clr-namespace:GesHoras.Designer_Controls"> 
    <!-- Resource dictionary entries should be defined here. -->  

    <!-- DragThumb Default Template --> 
    <Style TargetType="{x:Type s:DragThumb}"> 
    <Setter Property="Template"> 
     <Setter.Value> 
     <ControlTemplate TargetType="{x:Type s:DragThumb}"> 
      <Rectangle Fill="Transparent"/> 
     </ControlTemplate> 
     </Setter.Value> 
    </Setter> 
    </Style> 

    <!-- DesignerItem Style --> 
    <Style TargetType="{x:Type s:DesignerItem}">  
    <Setter Property="MinWidth" Value="20"/> 
    <Setter Property="MinHeight" Value="15"/> 
    <Setter Property="Template"> 
     <Setter.Value> 
     <ControlTemplate TargetType="{x:Type s:DesignerItem}"> 
      <Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"> 
      <!-- PART_DragThumb --> 
      <s:DragThumb x:Name="PART_DragThumb" Cursor="Hand"/> 

      <!-- PART_ContentPresenter --> 
      <ContentPresenter x:Name="PART_ContentPresenter" 
           Content="{TemplateBinding ContentControl.Content}" 
           Margin="{TemplateBinding ContentControl.Padding}"/>       

      </Grid> 
     </ControlTemplate> 
     </Setter.Value> 
    </Setter> 
    </Style> 

</ResourceDictionary> 

그것은 오류가 라인에 DesignerItem.xaml에 저에게 말한다 : 메시지

<Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"> 

나타나는 오류 :

'Path'속성에는 값이 없습니다.

아무도 도와 줄 수 있습니까?

감사합니다.

+0

흠 ... 퍼즐의 일부분이 누락 된 것처럼 보입니다. 질문을 다시 수정할 수 있습니까? – Anvaka

+0

질문자는 분명히 그의 요점을 놓치고 있습니다. 그의 코드는 명확하지 않으며 질문 된 질문과 관련이 없습니다. 이 질문에 -1 –

답변

0

DesignerItem.xaml :

<ResourceDictionary 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
      xmlns:s="clr-namespace:GesHoras.Designer_Controls"> 
     <!-- Resource dictionary entries should be defined here. -->  

      <!-- DragThumb Default Template --> 
      <Style TargetType="{x:Type s:DragThumb}"> 
      <Setter Property="Template"> 
       <Setter.Value> 
        <ControlTemplate TargetType="{x:Type s:DragThumb}"> 
         <Rectangle Fill="Transparent"/> 
        </ControlTemplate> 
       </Setter.Value> 
      </Setter> 
     </Style> 

     <!-- DesignerItem Style --> 
     <Style TargetType="{x:Type s:DesignerItem}">  
      <Setter Property="MinWidth" Value="20"/> 
       <Setter Property="MinHeight" Value="15"/> 
        <Setter Property="Template"> 
        <Setter.Value> 
         <ControlTemplate TargetType="{x:Type s:DesignerItem}"> 
          <Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"> 
           <!-- PART_DragThumb --> 
           <s:DragThumb x:Name="PART_DragThumb" Cursor="Hand"/> 

          <!-- PART_ContentPresenter --> 
           <ContentPresenter x:Name="PART_ContentPresenter" 
            Content="{TemplateBinding ContentControl.Content}" 
            Margin="{TemplateBinding ContentControl.Padding}"/>        

         </Grid> 
        </ControlTemplate> 
       </Setter.Value> 
      </Setter> 
     </Style> 

    </ResourceDictionary> 

문제는 일치한다 :

<Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"> 

그것은 그 경로가없는 나에게 말한다 또는 값이 없습니다.

감사합니다.

관련 문제