You can replace a pages <Grid> with <Canvas> instead if you want to use absolute positioning:

    <Canvas Width="800" Height="480">

        <!-- IMAGE -->
        <Image x:Name="imgBackground" Source="Assets/MyImage.png" Stretch="UniformToFill" />

        <Rectangle Fill="Red" Height="44" Width="44"/>
        <Rectangle Fill="Blue" Height="44" Width="44" Canvas.Left="20" Canvas.Top="20"/>
        <Rectangle Fill="Green" Height="44" Width="44" Canvas.Left="40" Canvas.Top="40"/>
        <Rectangle Fill="Orange" Height="44" Width="44" Canvas.Left="60" Canvas.Top="60"/>
    </Canvas>

Fill Parent Container / Screen

<Canvas Background="#FFF7F7F7" Width="{Binding Path=ActualWidth, ElementName=container}" Height="{Binding Path=ActualHeight, ElementName=container}">
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *