이 CustomControl에는 InkPresenter
과 Image
이 있습니다. 이미지에 나중에 adorner를 추가 할 예정이므로 이미지에 AdornerDecorator
이 있습니다. 이 이미지 위에 그려 지도록 의 Canvas.ZIndex
을 InkPresenter
보다 높게 설정했습니다.Image와 InkPresenter 사이의 Z 순서
InkPresenter
에서 잉크를 수집하고 표시하려고하면 이미지 아래에 획이 그려지는 것이 문제입니다. (나는 스눕을 사용하여 시각적 트리를 확인하는 데 익숙해졌으며 InkPresenter
은 Image
위에있다.) 나는 이것이 왜 있는지 모른다. 여기에 누구도 Image
이 InkPresenter
위에 그려진 이유를 알고 있습니까? 어떤 도움이라도 대단히 감사합니다.
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>
을 나는 InkPresenter
에 MouseDown
, MouseUp
, MouseMove
등 이벤트를 첨부 나는이 사건의 처리를 이동 계획 할 때 다음과 같이
내 코드입니다 나중에 다른 클래스에.
불행히도 Image
이 InkPresenter
위에 그려서 InkPresenter
이 아닌 이벤트가 발생하기 때문에 이러한 이벤트가 캡처되지 않습니다. 왜이 사람이 될 수 있는지 아는 사람 있습니까?
도움을 주시면 감사하겠습니다.
감사를 참조, 사용자에 가까운 : D 난 항상 가지고 그 다른 방법으로 라운드 ... : S – Nilu