adornerdecorator

What's the point to WPF adorners?

家住魔仙堡 提交于 2019-12-10 09:23:32
问题 I've recently developed a drawing component for my company, featuring a Canvas on which you can draw certain shapes using click-and-drag. For each shape, I placed two adorners on its AdornerLayer: One for increased hit detection (basically a transparent rectangle that would exceed the shape's boundaries by a few pixels), and another for resizing (four Thumb controls on the corners). But, I ran into many problems when implementing some of the features of the component, all adorner related.

WPF- Validation -The validation error message goes behind the other controls because of AdornerDecorator

烈酒焚心 提交于 2019-12-07 06:31:51
问题 I have implemented IDataErrorInfo in my ViewModel to return a string if the text box has error. public string this[string columnName] { get { return "Error-- This is a long error message - sd"; } } But this error message goes behind the other control on the UI as shown below. Below is the xaml: <Window x:Class="Test.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="600" Width="600"> <Window

Why AdornerLayers are always the top most layers? Is there a way to change it?

喜欢而已 提交于 2019-12-06 07:28:18
问题 Why is that the adorner layer is always rendered as the top most layer in an application (under AdornerDecorator - refer screenshot)? Is there a way to change the layer/level on to which the adorners can be drawn? In the following screenshot, AdornerLayer is added to AdornerDecorator and the Adorners (MyAdorners) are added to this AdornerLayer. But the AdornerLayer is retrieved like this, AdornerLayer layer1 = AdornerLayer.GetAdornerLayer(button1); layer1.Add(new MyAdorner(button1)); 回答1: To

What's the point to WPF adorners?

Deadly 提交于 2019-12-05 17:58:00
I've recently developed a drawing component for my company, featuring a Canvas on which you can draw certain shapes using click-and-drag. For each shape, I placed two adorners on its AdornerLayer: One for increased hit detection (basically a transparent rectangle that would exceed the shape's boundaries by a few pixels), and another for resizing (four Thumb controls on the corners). But, I ran into many problems when implementing some of the features of the component, all adorner related. They captured all preview events, since they were in another visual tree than the Canvas itself, that was

WPF- Validation -The validation error message goes behind the other controls because of AdornerDecorator

可紊 提交于 2019-12-05 11:09:29
I have implemented IDataErrorInfo in my ViewModel to return a string if the text box has error. public string this[string columnName] { get { return "Error-- This is a long error message - sd"; } } But this error message goes behind the other control on the UI as shown below. Below is the xaml: <Window x:Class="Test.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="600" Width="600"> <Window.Resources> <ControlTemplate x:Key="validationTemplateNew"> <DockPanel LastChildFill="True"> <TextBlock

Why AdornerLayers are always the top most layers? Is there a way to change it?

▼魔方 西西 提交于 2019-12-04 13:20:17
Why is that the adorner layer is always rendered as the top most layer in an application (under AdornerDecorator - refer screenshot)? Is there a way to change the layer/level on to which the adorners can be drawn? In the following screenshot, AdornerLayer is added to AdornerDecorator and the Adorners (MyAdorners) are added to this AdornerLayer. But the AdornerLayer is retrieved like this, AdornerLayer layer1 = AdornerLayer.GetAdornerLayer(button1); layer1.Add(new MyAdorner(button1)); To answer my second question, Is there a way to change the layer/level on to which the adorners can be drawn? I