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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:12:30+00:00 2026-05-16T10:12:30+00:00

There are following object: ‘FieldItem’ custom control; ‘Field’ – … XAML-object, which will contains

  • 0

There are following object:

  • ‘FieldItem’ custom control;
  • ‘Field’ – … XAML-object, which will contains a dozen of field items;
  • FieldItemViewModel – data class that hosts data to be displayed with ‘FieldItem’ custom control;
  • position of ‘FieldItem’ control depend from data entity parameters that is bounded to the control (X and Y);
  • items – ObservableCollection – collection that contains a data.

Question: what kind of object should I put inside of the in order to have each item of the my FieldItems to be displayed inside of Canvas?

I’ve planned to use ListView… but… can’t imagine how is it possible to change position of the list view item…

Any thoughts are welcome!

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-05-16T10:12:31+00:00Added an answer on May 16, 2026 at 10:12 am

    You can have a simple ItemsControl.
    ItemsControl is just a container of items.
    The ItemsPanel should be set to your canvas. And the data template of each item should be the ‘FieldItem’ control.
    In your viewmodel expose a property that is called Items which will be a collection of the items data.
    Something similar to this:

    <ItemsControl ItemsSource="{Binding Items}">
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <FieldItem  />
        </DataTemplate>
    </ItemsControl.ItemTemplate>
      <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <Canvas />
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
    

    Silverlight doesn’t have ItemContainerStyle but you can set it in code:

       public class MyItemsControl : ItemsControl
        {
            protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
            {
                FrameworkElement contentitem = element as FrameworkElement;
                Binding leftBinding = new Binding("Position.X");
                Binding topBinding = new Binding("Position.Y");
                contentitem.SetBinding(Canvas.LeftProperty, leftBinding);
                contentitem.SetBinding(Canvas.TopProperty, topBinding);
                base.PrepareContainerForItemOverride(element, item);
            }
        }
    

    Taken from here: http://forums.silverlight.net/forums/p/29753/96429.aspx

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

Sidebar

Related Questions

Is there any difference between following two ways of creating an object. Student s1
Propose to consider the following problem. Suppose we have some composite object. Are there
I need to implement the following: There is a table A which is supposed
We have the following setting: There is a web application which has a jboss
I have the following situation: There is one custom view inside of the first
I have the following object M , from which I need to extract the
I have some JS code which generates the following object, return { type: some
For example, consider the following: There is a class Text Group which is a
We have the following object int [,] oGridCells; which is only used with a
Examine the following code: Object object = new Object(); objectList.add(object); objectListTwo.add(object); Is there any

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.