Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8245447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:10:46+00:00 2026-06-07T22:10:46+00:00

Here is my xaml code (simplified) <Canvas Name=c1> <misc controls Canvas.ZIndex=1> <Canvas Name=c2> <Button

  • 0

Here is my xaml code (simplified)

<Canvas Name="c1">
   <misc controls Canvas.ZIndex="1">
   <Canvas Name="c2">
      <Button Canvas.ZIndex="2" Name="b1" />
      <misc>
   </Canvas>
</Canvas>

I wish that the button is placed above the misc controls in Canvas c1. So I use the Canvas.ZIndex property. But it is relative to Canvas c2 and I would like it to be relative to Canvas c1.
How could I do that ? Is there a way to specify the root canvas of the zindex property ?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T22:10:48+00:00Added an answer on June 7, 2026 at 10:10 pm

    The button on Canvas 2 knows nothing about Canvas 1. Set the z index of Canvas 2 as a whole instead.

    <Canvas Name="c1">
       <misc controls Canvas.ZIndex="1">
       <Canvas ZIndex="2" Name="c2">
          <Button Name="b1" />
          <misc>
       </Canvas>
    </Canvas>
    

    (Or simply re-order your tags)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my xaml <Button x:Name=btnTest Width=88 Content={Binding Value, ElementName=slSlider} Height={Binding Value, ElementName=slSlider} HorizontalAlignment=Left ></Button>
here is the XAML... <Canvas Name=myCanvas> <TextBlock Name=myBlock FontFamily=Arial Black FontSize=100 Foreground=Red Text=R Height=105
Here is my XAML code: <TextBlock x:Name=subTitle Text={Binding Name} /> And my C# code:
Here's the simplified XML: <Product> <Name>Red Chair</Name> <Price>29.5</Price> </Product> Here's the simplified XAML in
Here's my XAML code: <Window x:Class=CarFinder.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=Search for cars in TuMomo Height=480
Here's the code for my window: <Window xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml x:Class=leartWPF.ControlTestWindow x:Name=Window Title=ControlTestWindow Width=640 Height=480>
Here is the current code I am using: <UserControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml x:Class=ButtonPrototype.MainPage Width=640 Height=480>
Here's the XAML structure. You'll see below that I'm subscribing to the Loaded event
Here's my Xaml for a MediaElement: <MediaElement x:Name=mediaElement Width=400 Height=300 Stretch=UniformToFill IsMuted=True> <MediaElement.Triggers> <EventTrigger
So here is the XAML that I have: <ItemsControl ItemsSource={Binding Path=Groups} ItemTemplateSelector={Binding RelativeSource={RelativeSource AncestorType=Window},

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.