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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:23:10+00:00 2026-06-01T17:23:10+00:00

I have a canvas in an itemControl and for the data template I am

  • 0

I have a canvas in an itemControl and for the data template I am using ellipses. The position of each ellipse represents a time of day between 6am and 11pm. I am binding that value based on the size on of the canvas and where the time assigned to the ellipse falls. The ellispse top is not moving in the canvas at all. I have tried to remove the binding and use a hard value and it is still in the same place.

Here is the XAML for the container

        <ItemsControl Grid.Column="1" ItemsSource="{Binding AngerData}" VerticalAlignment="Stretch" Canvas.ZIndex="1">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <Canvas VerticalAlignment="Stretch"></Canvas>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Ellipse Height="10" Width="10" Stroke="White" StrokeThickness="1" 
                             Canvas.Top="{Binding Top, Converter={StaticResource ResourceKey=ellipsePositionConverter}, ConverterParameter=Month}" >"
                             Fill="{Binding AngerRating, Converter={StaticResource angerRatingConverter}}"
                             Canvas.ZIndex="100">
                    </Ellipse>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>

Here is the converter which I do not think is the issue given that removing it does not move the position of the ellipse

public class CalendarDayEllipsePositionConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        double gridPosition = 0;

        if (parameter.ToString().Equals("Month", StringComparison.InvariantCultureIgnoreCase))
        {
            gridPosition = double.Parse(value.ToString()) * 110;
        }

        return gridPosition;
    }

    public object ConvertBack(object value, Type targetTypes, object parameter, System.Globalization.CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}

Any help would be appreciated

  • 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-01T17:23:12+00:00Added an answer on June 1, 2026 at 5:23 pm

    Does the Canvas control have a Height set?

    Can you put a breakpoint on the first line for Convert method in Converter just to check if it is called?

    … Try this instead:

    <Canvas VerticalAlignment="Stretch">
                <ItemsControl Grid.Column="1"
                          VerticalAlignment="Stretch"
                          Canvas.ZIndex="1"
                          ItemsSource="{Binding AngerData}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Ellipse Canvas.Top="{Binding 
                                                      Converter={StaticResource ResourceKey=ellipsePositionConverter},
                                                      ConverterParameter=Month}"
                                 Width="10"
                                 Height="10"
                                 Canvas.ZIndex="100"
                                 Fill="Red"
                                 Stroke="White"
                                 StrokeThickness="1" />
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
    
                </ItemsControl>
            </Canvas>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have list of items that I want to display in Canvas using data
I have a Canvas with a scale translation applied in XAML. Using DrawingContext I
I have a Canvas element, contained within a ScrollViewer, which I'm zooming using ScaleTransform.
I have a canvas that I am using a javascript function to display text
i have a canvas and an image inside canvas.i need know the position of
Lets say I have an ItemsControl in a Canvas. Each Item will have its
I have two Canvas A and B, A is the child of B. A
I have a canvas which contains a single myComponentA. A myComponentA contains a MyComponentB.
I have a Canvas which has many components inside it and those again, have
I Have a canvas and would like to place silverlight elements within that canvas

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.