-
- Nir Hasson
- Posts: 71
- Joined:
- Contact:
Dynamic Elements Scale
I've got custom items control container which uses a custom data template to display the hosted items.
I'd like to control the size of each item in order to support dynamic number of displayed items.
I've modified my custom data template to have binding to the ScaleX and ScaleY properties of the root grid Layout ScaleTransform .
When I launched the application I've noticed that the bindings don't work. The ScaleX and ScaleY properties of the ScaleTransform simply use their default value which is 1..
Any suggestions how to dynamically control the scale of my elements?
I'd like to control the size of each item in order to support dynamic number of displayed items.
I've modified my custom data template to have binding to the ScaleX and ScaleY properties of the root grid Layout ScaleTransform .
When I launched the application I've noticed that the bindings don't work. The ScaleX and ScaleY properties of the ScaleTransform simply use their default value which is 1..

Any suggestions how to dynamically control the scale of my elements?
-
-
sfernandez
Site Admin
- Posts: 3264
- Joined:
Re: Dynamic Elements Scale
Could you please write a small piece of xaml so we can see the logical/visual tree. This way we can guess what could be happening.
Thanks.
Thanks.
-
- Nir Hasson
- Posts: 71
- Joined:
- Contact:
Re: Dynamic Elements Scale
Here it is -
Note that the binding for the visibility property works well..
Note that the binding for the visibility property works well..
Code: Select all
<DataTemplate x:Key="CubrDataTemplate">
<Grid x:Name="grid" Height="Auto" Width="Auto" Background="{x:Null}" Margin="1" Visibility="{Binding TraineeVisibility, Mode=OneWay}">
<Grid.LayoutTransform>
<TransformGroup>
<ScaleTransform ScaleX="{Binding TraineeLayoutScaleX, Mode=OneWay}" ScaleY="{Binding TraineeLayoutScaleY, Mode=OneWay}"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Grid.LayoutTransform>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="64"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="64"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="80"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
</Grid>
</DataTemplate>
-
-
sfernandez
Site Admin
- Posts: 3264
- Joined:
Re: Dynamic Elements Scale
Something I forgot to ask, are you using 1.1 or 1.2 version?
And about the DataTemplate, is it used something like this?
And about the DataTemplate, is it used something like this?
Code: Select all
<ItemsControl ItemsSource="{Binding Items}" ItemTemplate="{StaticResource CubrDataTemplate}"/>
-
- Nir Hasson
- Posts: 71
- Joined:
- Contact:
Re: Dynamic Elements Scale
I'm using 1.1 and the usage is exactly as you mentioned.
-
-
sfernandez
Site Admin
- Posts: 3264
- Joined:
Re: Dynamic Elements Scale
I was able to reproduce the problem, we are looking into this issue.
I'll let you know when we found a solution.
Thanks for reporting.
I'll let you know when we found a solution.
Thanks for reporting.
-
- Nir Hasson
- Posts: 71
- Joined:
- Contact:
Re: Dynamic Elements Scale
In the meanwhile I was able to make it work by finding the host UI Container and apply the layout transform explicitly to it...
-
-
sfernandez
Site Admin
- Posts: 3264
- Joined:
Re: Dynamic Elements Scale
Ok, good to know.
Anyhow I found the source of the problem, so you will find this issue solved in the next release.
Anyhow I found the source of the problem, so you will find this issue solved in the next release.
Who is online
Users browsing this forum: No registered users and 6 guests