hei,
assume that i have this code:
<StackPanel>
<Canvas x:Name="canvas" Height="400" Width="235">
<Image x:Name="image" Source="/SplashScreenImage.jpg" Stretch="Fill">
<Image.RenderTransform>
<CompositeTransform ScaleX="0.5" ScaleY="0.5"/>
</Image.RenderTransform>
</Image>
<TextBlock Canvas.ZIndex="1" Text="TextBlock" Canvas.Left="61" Canvas.Top="150"/>
</Canvas>
<TextBlock HorizontalAlignment="Center" >Test</TextBlock>
</StackPanel>
What i want to do is the canvas’s width and height properties linked to image. something like this:
<Canvas x:Name="canvas" Height="{image Height}" Width="{image Width"}>
since I have been previously using Qt Quick and this is quite easy, they call it property binding. I am wondering if this is possible in XAML as well ?
Thanks.
I think I found the solution, example: