tags:

views:

33

answers:

1

Is there any way whether we can stretch Element placed inside a Convas if we give the Horizotal and Vertical Alignment properties to Stretch?

A: 

You could try something like this:

<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300">
    <Canvas Name="theCanvas">
        <Button Content="Hello" Width="{Binding ActualWidth, ElementName=theCanvas}" />
    </Canvas>
</Window>
Adel Hazzah