This project is read-only.

Z-order of the StickyNote object

Jul 9, 2012 at 9:36 AM

Hello Koen,

I would like to make the selected stickynote object the upper one (meaning its z-order).

How to implement this ?

 

Thank you,

Masha Youlus-Susskind

Jul 9, 2012 at 11:16 AM

Hi Masha,

A page in document toolkit has a number of visual layers. The layers are listed below (lowest on top)

  1. page content layer
  2. annotation layer (AnnotationRenderContext.AnnotationLayer)
  3. text selection layer
  4. annotation adorner layer (AnnotationRenderContext.AnnotationAdornerLayer)

All layers are clipped to the page size. Sticky notes are already rendered in the top most layer (that is the annotation adorner layer).

- Koen

Jul 9, 2012 at 12:00 PM

Thank you,

I just want to make one specific sticky note the topmost one (in the case of overlapping sticky notes).

Thanks, Masha Youlus-Susskind

Jul 9, 2012 at 10:06 PM

Hi Masha,

Either make sure the sticky note is the element in Children collection of the AnnotationAdornerLayer (which is a Canvas element), or assign a high Canvas.ZIndex attached property to it.

- Koen

Jul 11, 2012 at 12:37 PM

Hi Koen.

My name is Alex and I am a Masha's colleague.

How can I obtain StickyNoteControl object related to some StickyNote object?

I have found StickyNote property inside a StickyNoteControl object, but I need just the opposite:

 StickyNoteControl property inside a StickyNote object.

 

Thanks, 

Alex.

Jul 11, 2012 at 4:44 PM

Hi Alex,

The StickyNote annotation creates a StickyNoteControl instance in the RenderAnnotation method. The RenderAnnotation method is invoked each time Document Toolkit has determined an annotation is visible. Annotation visuals are automatically removed when no longer visible. This implies that there is no 1:1 relation between an annotation and its visual. RenderAnnotation may be invoked N times for a single StickyNote instance.

Why do you need a StickyNoteControl reference from inside a StickyNote?

- Koen

Jul 12, 2012 at 6:03 AM

Hi Koen.

I need StickyNoteControl because I want to change a ZIndex property value for some sticky note, but I have an access to logical StickyNote object only and not to a visual StickyNoteControl object. 

 I thought, it must be a way to reach a visual StickyNoteControl object from its logical StickyNote object companion.

Ability to change a ZIndex property value of a StickyNote object is very crucial in our project, because the absence of this ability may lead to a vulnerability issue in our project.

 

Thanks,

Alex.

 

Jul 12, 2012 at 2:32 PM

Hi Alex,

What are the triggers for changing the ZIndex? Can't you set the ZIndex in the RenderAnnotation method?

- Koen

Jul 15, 2012 at 5:11 AM

Hello, Koen.

The problem is that RenderAnnotation method is called automatically (on Annotation creation),

but I want to be able to change, manually, visual properties of some annotation after its creation.

Is there some way to change visual properties of some annotation after its creation?

 

Thanks,

Alex.

Jul 15, 2012 at 7:57 AM

Hello, Koen.

In addition to my previous question,

if I can, explicitly, call the RenderAnnotation method from a code, so where can I find the AnnotationRenderContext object parameter to pass to RenderAnnotation method?

 Can you send an example that calls the RenderAnnotation method explicitly?  

 

Thanks,

Alex.

Jul 17, 2012 at 11:30 AM

Hi Alex,

You can't invoke the RenderAnnotation yourself. The render context is provided by Document Toolkit and RenderAnnotation is invoked every time the page containing your annotation switches from a hidden to a visible state. 

The Ink annotation (also available in the source of this project) has a similar issue, it needs to modify existing annotations. The modification is done by the InkEditor which is a behavior attached to a single FixedPageViewer. Whenever a page is loaded (ie it becomes visible), the InkEditor searches for the ink annotation in the annotation store and renders the annotation. Annotation rendering is not done in the annation.RenderAnnotation method, but by the InkEditor.

Document Toolkit originally was designed to render readonly annotations (like strikethough, highlight, etc). Support for editable annotations is not build and requires solutions such as the one used by the InkEditor.

The source code of the Ink, InkEditor and InkFactory classes is available in the source at 2.5/Document Toolkit Extensions/Client/FirstFloor.Documents.Presentation/Annotations

Hope this helps,

- Koen