Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure if it will work in your scenario, but I've accomplished this in the past using the RenderTransform.</p> <pre><code>&lt;ItemsControl&gt; &lt;ItemsControl.ItemsPanel&gt; &lt;ItemsPanelTemplate&gt; &lt;Canvas Background="Green" /&gt; &lt;/ItemsPanelTemplate&gt; &lt;/ItemsControl.ItemsPanel&gt; &lt;ItemsControl.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;TextBox Text="{Binding}"&gt; &lt;TextBox.RenderTransform&gt; &lt;TranslateTransform X="100" Y="100" /&gt; &lt;/TextBox.RenderTransform&gt; &lt;/TextBox&gt; &lt;/DataTemplate&gt; &lt;/ItemsControl.ItemTemplate&gt; &lt;ItemsControl.Items&gt; &lt;System:Int32&gt;10&lt;/System:Int32&gt; &lt;System:Int32&gt;30&lt;/System:Int32&gt; &lt;System:Int32&gt;50&lt;/System:Int32&gt; &lt;System:Int32&gt;70&lt;/System:Int32&gt; &lt;/ItemsControl.Items&gt; &lt;/ItemsControl&gt; </code></pre> <p>Or in the case of binding you will need to use a converter</p> <pre><code>&lt;ItemsControl&gt; &lt;ItemsControl.ItemsPanel&gt; &lt;ItemsPanelTemplate&gt; &lt;Canvas Background="Green" /&gt; &lt;/ItemsPanelTemplate&gt; &lt;/ItemsControl.ItemsPanel&gt; &lt;ItemsControl.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;TextBox Text="{Binding}" RenderTransform="{Binding Converter={StaticResource NumberToTransformGroupConverter}}" /&gt; &lt;/DataTemplate&gt; &lt;/ItemsControl.ItemTemplate&gt; &lt;ItemsControl.Items&gt; &lt;System:Int32&gt;10&lt;/System:Int32&gt; &lt;System:Int32&gt;30&lt;/System:Int32&gt; &lt;System:Int32&gt;50&lt;/System:Int32&gt; &lt;System:Int32&gt;70&lt;/System:Int32&gt; &lt;/ItemsControl.Items&gt; &lt;/ItemsControl&gt; </code></pre> <h2>Converter</h2> <pre><code>public void ConvertTo(object value, ...) { int intValue = int.Parse(value.ToString()); return new TransformGroup() { Children = new TransformCollection() { new TranslateTransform { X = intValue, Y = intValue } } }; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload