2009-07-22 8 views
1

이 CustomControl에는 InkPresenterImage이 있습니다. 이미지에 나중에 adorner를 추가 할 예정이므로 이미지에 AdornerDecorator이 있습니다. 이 이미지 위에 그려 지도록 의 Canvas.ZIndexInkPresenter보다 높게 설정했습니다.Image와 InkPresenter 사이의 Z 순서

InkPresenter에서 잉크를 수집하고 표시하려고하면 이미지 아래에 획이 그려지는 것이 문제입니다. (나는 스눕을 사용하여 시각적 트리를 확인하는 데 익숙해졌으며 InkPresenterImage 위에있다.) 나는 이것이 왜 있는지 모른다. 여기에 누구도 ImageInkPresenter 위에 그려진 이유를 알고 있습니까? 어떤 도움이라도 대단히 감사합니다.

generic.xaml을

<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="clr-namespace:HotSpotImage"> 
    <Style TargetType="{x:Type local:HotSpotImage}"> 
     <Setter Property="Template"> 
      <Setter.Value> 
       <ControlTemplate TargetType="{x:Type local:HotSpotImage}"> 
        <ControlTemplate.Resources> 
         <local:StringtoImageSource x:Key="ImageSourceConverter"/> 

        </ControlTemplate.Resources> 
        <Canvas Width="{TemplateBinding Width}" 
          Height="{TemplateBinding Height}">  
         <InkPresenter Canvas.ZIndex="1" 
             x:Name="PART_InkPresenter" 
             Width="{TemplateBinding Width}" 
             Height="{TemplateBinding Height}"/> 
         <Image Canvas.ZIndex="2" x:Name="PART_Image" 
           Width="{TemplateBinding Width}" 
           Height="{TemplateBinding Height}" Source="{Binding 
           RelativeSource={RelativeSource TemplatedParent}, 
           Path=Source, 
           Converter={StaticResource ImageSourceConverter}}"/> 
        </Canvas> 
       </ControlTemplate> 
      </Setter.Value> 
     </Setter> 
    </Style> 
</ResourceDictionary> 

을 나는 InkPresenterMouseDown, MouseUp, MouseMove 등 이벤트를 첨부 나는이 사건의 처리를 이동 계획 할 때 다음과 같이

내 코드입니다 나중에 다른 클래스에.

불행히도 ImageInkPresenter 위에 그려서 InkPresenter이 아닌 이벤트가 발생하기 때문에 이러한 이벤트가 캡처되지 않습니다. 왜이 사람이 될 수 있는지 아는 사람 있습니까?

도움을 주시면 감사하겠습니다.

답변

1

z 순서를 거꾸로 생각하고 있습니다. 높은 값에 따라서 값 2 이미지 값으로 잉크를 통해 그려진 1.

MSDN

+0

감사를 참조, 사용자에 가까운 : D 난 항상 가지고 그 다른 방법으로 라운드 ... : S – Nilu