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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:33:28+00:00 2026-05-15T12:33:28+00:00

I have the following structure in XAML: <Grid> <ItemsControl x:Name=Items ItemsSource={Binding Path=Pages} Grid.Row=0 Grid.Column=0>

  • 0

I have the following structure in XAML:

<Grid>
  <ItemsControl x:Name="Items" ItemsSource="{Binding Path=Pages}" Grid.Row="0" Grid.Column="0">
    <ItemsControl.ItemsPanel>
      <ItemsPanelTemplate>
        <StackPanel Orientation="Vertical" />
      </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>

    <ItemsControl.ItemTemplate>
      <DataTemplate>
        <!-- Display a white page for each page item -->
        <local:PageView Margin="0, 25, 0, 0" />
      </DataTemplate>
    </ItemsControl.ItemTemplate>
  </ItemsControl>

  <!-- Layer used for displaying preview of drawn shape -->
  <local:PreviewLayer x:Name="PreviewLayer" Grid.Row="0" Grid.Column="0"/>
</Grid>

The customer will be drawing on the preview layer a shape, let suppose a rectangle. Once the drawing is done, the shape will be added to the page below the shape.

My problem is the X,Y of the resulting rectangle is in the coordinate system of the PreviewLayer. How can I convert the bounds of a rectangle from the PreviewLayer to a PageView?

I am currently getting the needed pageView by using (the page variable is obtained elsewhere)

UIElement pageView = (UIElement)this.Items.ItemContainerGenerator.ContainerFromItem(page);

But I don’t know how to get the coordinate of the pageView returned. Using Canvas.GetLeft(pageView) returns NaN.

How can I get the pageView bounds?

  • 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-15T12:33:29+00:00Added an answer on May 15, 2026 at 12:33 pm

    I was able to figure it out by using TranslateToPoint. At first it wasn’t working, until I figured that ContainerFromItem returns a container of the item (which is logical if you read the name of the function, but I guess this went over my head).

    Getting the first child of of the container returned the element I needed for TranslateToPoint.

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

Sidebar

Related Questions

I have an XML file with the following structure: <Products> <Product name=MyProduct1> <Components> <Component
I have the following directory structure Project \Images +view.png control.xaml and in the control
I have following table structure in my DB ID Name -------------------------- ID_1 Name1 ID1
I have following structure for check-boxes <input type=checkbox name=reg_field['first_name'] value=1 /> First Name<br />
I have following db structure in mysql. Table: Story Id Name categoryid date 1
I have following table structure ID Name Parent_ID 1 abc 0 2 efg 1
one more problem. I have following structure of XML: <player> <id>12</id> <name>pl_name</name> <experience> <points>147</points>
Hi guys we have following structure in one of our project's pages: <asp:UpdatePanel ID=up1
I have following structure with example data: id season_id title 1 1 Intro 2
I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party

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.