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

  • Home
  • SEARCH
  • 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 6716999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:48:02+00:00 2026-05-26T08:48:02+00:00

given the following XAML code: <Canvas Name=MainView> <Canvas Name=TriangleElement Width=50 Height=50 Canvas.Left=110 Canvas.Top=100> <Canvas.RenderTransform>

  • 0

given the following XAML code:

<Canvas Name="MainView">

    <Canvas Name="TriangleElement" Width="50" Height="50" Canvas.Left="110" Canvas.Top="100">
        <Canvas.RenderTransform>
            <RotateTransform CenterX="25" CenterY="25" Angle="0" />
        </Canvas.RenderTransform>
        <Path Stroke="#FF009600" StrokeThickness="1" Fill="#FF68E168">
            <Path.Data>
                M 0,0 L 50,0 50,50 Z
            </Path.Data>
        </Path>
    </Canvas>

    <Canvas Name="SquareElement" Width="50" Height="50" Canvas.Left="170" Canvas.Top="100">
        <Canvas.RenderTransform>
            <RotateTransform CenterX="25" CenterY="25" Angle="0" />
        </Canvas.RenderTransform>
        <Path Stroke="#FF005DFF" StrokeThickness="1" Fill="#FF98D0F8">
            <Path.Data>M 0,0 L 50,0 50,50 0,50 Z</Path.Data>
        </Path>
    </Canvas>

</Canvas>

How can I get the path data / geometry information in c# without naming it in the XAML? In the past I have created several UserControl’s, created an interface to the objects, and pulled the info based on the Path name. In my current case I cannot use this approach.

  • 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-05-26T08:48:03+00:00Added an answer on May 26, 2026 at 8:48 am

    Not sure if I understand the question, but can’t you use

    ((Path)TriangleElement.Children[0]).Data
    

    And what are those Canvas elements for? They don’t seem to be doing anything.

    Why not:

    <Path Name="SquareElement" Width="50" Height="50" Stroke="#FF005DFF" StrokeThickness="1" Fill="#FF98D0F8">
        <Path.RenderTransform>
            <RotateTransform CenterX="25" CenterY="25" Angle="60" />
        </Path.RenderTransform>
        <Path.Data>M 0,0 L 50,0 50,50 0,50 Z</Path.Data>
    </Path>
    

    Then you can get straight to your paths by name.

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

Sidebar

Related Questions

Given the following bit of XAML <Border Name=Brder Visibility=Visible Width=10 Height=10 Background=Red></Border> <Button Content=Hide></Button>
Given the following XAML code that with a ListControl like behavior: <StackPanel> <ItemsControl Name=_listbox
Given the following XAML... <ComboBox x:Name=advisoriesComboBox DisplayMemberPath=Name ItemsSource={Binding Path=Advisories} SelectedItem={Binding Path=SelectedAdvisory} /> <Button Command={Binding
Given the following code: <Window x:Class=WpfApplication76.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:col=clr-namespace:System.Collections;assembly=mscorlib Title=Window1 Height=300 Width=300> <Window.Resources> <CollectionViewSource
Given the following xaml code, I would like to create this xaml code the
Given the following code: <MenuItem x:Name=MenuItem_Root Header=Root> <MenuItem x:Name=MenuItem_Item1 IsCheckable=True Header=item1 /> <MenuItem x:Name=MenuItem_Item2
Given the following list of presidents do a top ten word count in the
Given the following code, is there a way I can call class A's version
Given the following C# code: var product = new List<int>(); for (int n1 =
Given the following XAML my goal is to keep the columns AAA, BBB, CCC

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.