I have three buttons lying one by one. I want to show top of all button, which i click. So that I have set canvas ZIndex in XAML Code. But I want to do this in Code Behind.
You can set z index in code like this-
Panel.SetZIndex(control name, int index);
Z-index canbe set like this..
Panel.SetZIndex(Button2, 10);
An attached property is set from code using by convention the SetPropertyName function.
Panel.SetZIndex(Button2, 0);