Translate : Transform « Windows Presentation Foundation « C# / CSharp Tutorial






<Window x:Class="Workspace.DockExample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Workspace" Width="640" Height="480">
        <Canvas Height="200" Width="200">
          <Polyline Points="25,25 0,50 25,75 50,50 25,25 25,0" Stroke="Blue" StrokeThickness="10"
            Canvas.Left="75" Canvas.Top="50">
            <Polyline.RenderTransform>
              <TranslateTransform X="50" Y="0" />
            </Polyline.RenderTransform>
          </Polyline>
          
          <!-- Shows the original position of the polyline. -->
          <Polyline Points="25,25 0,50 25,75 50,50 25,25 25,0" Stroke="Blue" StrokeThickness="10"
            Opacity="0.25" Canvas.Left="75" Canvas.Top="50" />            
        </Canvas>

</Window>
WPF Translate








24.104.Transform
24.104.1.RotateRotate
24.104.2.TranslateTranslate
24.104.3.Applies a RotateTransform to the DrawingBrush's RelativeTransform propertyApplies a RotateTransform to the DrawingBrush's RelativeTransform property