No Canvas.ZIndex or SetZIndex() property on WPF Canvas -
i might being stupid, i'm trying change z order of components on wpf canvas, doesn't seem exist xaml property or method in code behind.
here's xaml:
<usercontrol x:class="frontendui.controls.radialtracker" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:frontendui.controls" mc:ignorable="d" d:designheight="500" d:designwidth="500"> <grid > <canvas x:name="trackercanvas"> </canvas> </grid>
at first trying programatically:
then tried adding path using xaml , setting canvas.zindex, didn't exist. there panel.zindex though, i'm assuming referring higher in ui (the grid, or user control itself?)
not sure how procede, documentation points existing:
https://msdn.microsoft.com/en-us/library/system.windows.controls.panel.zindex(v=vs.110).aspx
http://blogs.msdn.com/b/wpfsdk/archive/2006/06/13/controlling-zorder-using-the-zindex-property.aspx
https://msdn.microsoft.com/en-us/library/bb980110(v=vs.95).aspx
i've come across loads of stack overflow questions:
how set canvas zindex wpf button control in click event?
but use canvas.zindex, know why happening?
canvas inherits panel. panel.setzindex() static method , panel.zindex attached property why not seeing in xaml.
to set zindex child components in xaml.
<canvas > <button content="button" panel.zindex="1" /> </canvas>
to set zindex child components in code behind.
canvas.setzindex(control, index);
you said "there panel.zindex though, i'm assuming referring higher in ui (the grid, or user control itself?)"
your assumption wrong. achieve requirement need set panel.zindex
you asked : use canvas.zindex, know why happening?
because zindex attached property (and not regular dependency property).
Comments
Post a Comment