Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Nodes and Buttons XAML, how to set Z-index? (Read 3750 times)
ulthien
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 91
Location: Munich
Joined: Nov 29th, 2011
Nodes and Buttons XAML, how to set Z-index?
Jul 13th, 2012 at 3:19pm
Print Post  
hello,

just added some nodes and buttons in XAML, and when these overlap, buttons are always behind the nodes.

I try set the DiagramNodeAdapter that is button to ZTop() and node.ZBottom(), but node always overlaps the buttons visually :/

Even when i do this on e.g. MouseUP handler, still they dont order in Z-axis.

Is there a way to set their Canvas.SetZIndex(node, 99), or how do you advise to accomplish this?

cheers, thx in advance
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Nodes and Buttons XAML, how to set Z-index?
Reply #1 - Jul 16th, 2012 at 10:39am
Print Post  
Hi,

Both buttons appear in front of the node in my test app with this code:

Code
Select All
<diag:Diagram>
	<diag:ShapeNode Bounds="50,50,150,150" />
	<Button />
</diag:Diagram>

private void Window_Loaded(object s, RoutedEventArgs e)
{
	var button = new Button();
	var buttonNode = new DiagramNodeAdapter(diagram, button);
	buttonNode.Bounds = new Rect(140, 140, 66, 66);
	diagram.Nodes.Add(buttonNode);
} 



If your nodes are grouped, check the effect of the Diagram.SortGroupsByZ property. Otherwise please attach a test project that shows the problem.

Stoyan
  
Back to top
 
IP Logged
 
ulthien
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 91
Location: Munich
Joined: Nov 29th, 2011
Re: Nodes and Buttons XAML, how to set Z-index?
Reply #2 - Jul 16th, 2012 at 1:13pm
Print Post  
well both resources are given in our project per XAML, so after the nodes entry, something like:

<Button Name="SerB" Content="SERVICE" "
Width="70" Height="36" Style="{StaticResource roundeds}">
<Button.Background>
<VisualBrush>
<VisualBrush.Visual>
<Canvas>
<Canvas Name="SerButton" />
</Canvas>
</VisualBrush.Visual>
</VisualBrush>
</Button.Background>
</Button>

is instatiated, as we use Style to round off the button etc.

For this instance of the button i later change position and functional contents depending which node is selected etc. (basically same button is repositioned/reused)

and this XAML button seems to land always underneath the node i try position it on.
  
Back to top
 
IP Logged
 
ulthien
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 91
Location: Munich
Joined: Nov 29th, 2011
Re: Nodes and Buttons XAML, how to set Z-index?
Reply #3 - Jul 16th, 2012 at 2:48pm
Print Post  
* * * SOLVED! * * *

i implemented your code-behind button instancing to no avail, then i remembered the cryptic setup i used before christmas when similar problems occured in another diagram:

SelectionOnTop = false;

if the diagram does not contain this setup, on clicking the node it will pop up and no ZBottom() can send it to background if it is selected... (!!)


CAVEAT EMPTOR  Shocked

thank you..
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint