Rectangle and TranslateTransform example in Silverlight and XAML

Published on February 22, 2014 by abundantcode

Filed under Windows

Last modified February 22, 2014

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 3377 times

Below is a sample code snippet demonstrating how to use the TranslateTransform with the Rectangle control in Silverlight and XAML.

Rectangle and TranslateTransform example in Silverlight and XAML

<Canvas x:Name="ACCanvas" xmlns="http://schemas.microsoft.com/client/2007"

  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

  Width="400" Height="300" >

  <Canvas.Background>

    <SolidColorBrush Color="Yellow"/>

  </Canvas.Background>

  <Rectangle Width="190" Height="160"

    Fill="Red" Stroke="Green"

    Canvas.Left="200" Canvas.Top="50" RenderTransformOrigin="0,0" >

    <Rectangle.RenderTransform>

      <TranslateTransform X="100" Y="100"/>

    </Rectangle.RenderTransform>

  </Rectangle>

</Canvas>

Rectangle and TranslateTransform example in Silverlight and XAML

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment


x

You might be Interested in these Posts

How to Turnoff Frame rate counter in UWP App ?

You can turn off the frame rate counter in your Universal Windows Platform (UAP) apps by following t...

Creating a Button in UWP app by specifying the namespace as one of the attributes of button

You can add a button in your Universal Windows Platform (UWP) app by simply adding the Button tag in...

Keywords in XAML Language Namespace

Below are some of the keywords defined in the Xaml Language Namespace Keywords in XAML Language Nam...