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 8187337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:31:40+00:00 2026-06-07T02:31:40+00:00

I have a Border with some contents and a Line on a canvas. The

  • 0

I have a Border with some contents and a Line on a canvas. The Border + contents are draggable and the Line is updated to move with the Border. My problem is that the line is on top of the Border so in some situations it blocks my content. I have tried setting the ZIndex and changed their order in XAML but it doesn’t effect anything. I would hazard a guess it is because the Line is continually being rendered as it changes shape and for some reason outputs to the screen on top. Any way around this?

SOME OF MY CODE

XAML

<Canvas x:Name="canvas"
            MouseDown="Canvas_MouseDown"
            MouseUp="Canvas_MouseUp"
            MouseMove="Canvas_MouseMove">
            <Border BorderBrush="Aqua" BorderThickness="3" Padding="3" Name="bdr"
Background="{StaticResource GradientBackground}" Canvas.ZIndex="99"
                MouseLeftButtonDown="MouseLeftBtnDown">
                <Border.RenderTransform>
                    <TranslateTransform />
                </Border.RenderTransform>
    <button/>
            </Border>
        </Canvas>
        <Polygon
            Canvas.ZIndex="98"
            Name="SpeechPoly"
            Stroke="Aqua" 
            StrokeThickness="2"
            Fill="{StaticResource GradientBackground}">
        </Polygon>

C#

private void Dragging()
{
...
point = bdr.TransformToAncestor(this).Transform(new Point(0, 0));
myPoints.RemoveAt(1);
myPoints.RemoveAt(1);

myPoints.Add(new Point(p.X, p.Y + 50));
myPoints.Add(new Point(p.X, p.Y + 25));
SpeechPoly.Points = myPoints;
}
  • 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-07T02:31:42+00:00Added an answer on June 7, 2026 at 2:31 am

    Crap work around would be to determine where the line is coming from on the border (i.e. right/left hand side, top/bottom) and move it around the border.

    UPDATED

    if (p.X > myPoints[0].X)//right
    {
        if (p.Y + bdr.ActualHeight> myPoints[0].Y)//lower
        {
            myPoints.Add(new Point(p.X, p.Y + 50));
            myPoints.Add(new Point(p.X, p.Y + 25));
        }
        else//higher
        {
            myPoints.Add(new Point(p.X, p.Y + bdr.ActualHeight- 50));
            myPoints.Add(new Point(p.X, p.Y + bdr.ActualHeight - 25));
        }
    }
    else if (p.X + bdr.ActualWidth > myPoints[0].X)//Middle
    {
        if (p.Y + bdr.ActualHeight > myPoints[0].Y)//lower
        {
            myPoints.Add(new Point(p.X + (bdr.ActualWidth / 2) + 25, p.Y));
            myPoints.Add(new Point(p.X + (bdr.ActualWidth / 2), p.Y));
        }
        else if (p.Y + bdr.ActualHeight < myPoints[0].Y)//higher
        {
            myPoints.Add(new Point(p.X + (bdr.ActualWidth / 2) + 25, p.Y + bdr.ActualHeight));
            myPoints.Add(new Point(p.X + (bdr.ActualWidth / 2), p.Y + bdr.ActualHeight));
        }
    }
    else//left
    {
        if (p.Y > myPoints[0].Y)//lower
        {
            myPoints.Add(new Point(p.X + bdr.ActualWidth, p.Y + 50));
            myPoints.Add(new Point(p.X + bdr.ActualWidth, p.Y + 25));
        }
        else//higher
        {
            myPoints.Add(new Point(p.X + bdr.ActualWidth, p.Y + 50));
            myPoints.Add(new Point(p.X + bdr.ActualWidth, p.Y + 25));
        }
    }
    

    SOLUTION

    Had to have my Line within the same canvas as the border. Seems obvious now… Thanks Vincent!

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

Sidebar

Related Questions

Scenario: I have a view that has some DataTemplate resources <DataTemplate x:Key=myDragCueTemplate> <Border Background=Blue
I have a problem with css popup. I am hidden some content in span
I need to display some content within an area that will have rounded corners.
I have two divs one inside another. I have given some border to both
I have a border layout in ExtJS, The north region contains some HTML, but
I have some CCS defined as following: .FW_Buttons { -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius:
For some reason I have a very ugly orange part of a border around
Possible Duplicate: Default textbox border-style and width I have some TextBox on my page
I would like to have a border that is 4px thick pink on the
I am dealing with some HTML text that I basically have read access to.

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.