Nir Hasson
Topic Author
Posts: 71
Joined: 10 Nov 2013, 21:20
Contact:

Dynamic Elements Scale

11 Feb 2015, 16:15

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?
 
User avatar
sfernandez
Site Admin
Posts: 3264
Joined: 22 Dec 2011, 19:20

Re: Dynamic Elements Scale

11 Feb 2015, 18:13

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.
 
Nir Hasson
Topic Author
Posts: 71
Joined: 10 Nov 2013, 21:20
Contact:

Re: Dynamic Elements Scale

11 Feb 2015, 19:28

Here it is -
Note that the binding for the visibility property works well..

<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>
 
User avatar
sfernandez
Site Admin
Posts: 3264
Joined: 22 Dec 2011, 19:20

Re: Dynamic Elements Scale

11 Feb 2015, 19:48

Something I forgot to ask, are you using 1.1 or 1.2 version?

And about the DataTemplate, is it used something like this?
<ItemsControl ItemsSource="{Binding Items}" ItemTemplate="{StaticResource CubrDataTemplate}"/> 
 
Nir Hasson
Topic Author
Posts: 71
Joined: 10 Nov 2013, 21:20
Contact:

Re: Dynamic Elements Scale

11 Feb 2015, 20:04

I'm using 1.1 and the usage is exactly as you mentioned.
 
User avatar
sfernandez
Site Admin
Posts: 3264
Joined: 22 Dec 2011, 19:20

Re: Dynamic Elements Scale

14 Feb 2015, 20:42

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.
 
Nir Hasson
Topic Author
Posts: 71
Joined: 10 Nov 2013, 21:20
Contact:

Re: Dynamic Elements Scale

16 Feb 2015, 12:14

In the meanwhile I was able to make it work by finding the host UI Container and apply the layout transform explicitly to it...
 
User avatar
sfernandez
Site Admin
Posts: 3264
Joined: 22 Dec 2011, 19:20

Re: Dynamic Elements Scale

16 Feb 2015, 13:05

Ok, good to know.

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