< Canvas x:Name ="LayoutRoot" Background ="Yellow" > < Image Source ="Images/ultima.png" Name ="testImage" Height ="50" Width ="405" Canvas . Left ="0" Canvas . Top ="30" > < Image.Clip > < RectangleGeometry Rect ="0,0,45,50" x:Name ="tempRectangle" > </ RectangleGeometry > </ Image.Clip > </ Image > </ Canvas > * This source code was highlighted with Source Code Highlighter .
< Canvas x:Name ="LayoutRoot" Background ="Yellow" > < Image Source ="Images/ultima.png" Name ="testImage" Height ="50" Width ="405" Canvas . Left ="0" Canvas . Top ="30" > < Image.Clip > < RectangleGeometry Rect ="0,0,45,50" x:Name ="tempRectangle" > </ RectangleGeometry > </ Image.Clip > </ Image > </ Canvas > * This source code was highlighted with Source Code Highlighter .
< Canvas x:Name ="LayoutRoot" Background ="Yellow" > < Image Source ="Images/ultima.png" Name ="testImage" Height ="50" Width ="405" Canvas . Left ="0" Canvas . Top ="30" > < Image.Clip > < RectangleGeometry Rect ="0,0,45,50" x:Name ="tempRectangle" > </ RectangleGeometry > </ Image.Clip > </ Image > </ Canvas > * This source code was highlighted with Source Code Highlighter .
< Canvas x:Name ="LayoutRoot" Background ="Yellow" > < Image Source ="Images/ultima.png" Name ="testImage" Height ="50" Width ="405" Canvas . Left ="0" Canvas . Top ="30" > < Image.Clip > < RectangleGeometry Rect ="0,0,45,50" x:Name ="tempRectangle" > </ RectangleGeometry > </ Image.Clip > </ Image > </ Canvas > * This source code was highlighted with Source Code Highlighter .
< Canvas x:Name ="LayoutRoot" Background ="Yellow" > < Image Source ="Images/ultima.png" Name ="testImage" Height ="50" Width ="405" Canvas . Left ="0" Canvas . Top ="30" > < Image.Clip > < RectangleGeometry Rect ="0,0,45,50" x:Name ="tempRectangle" > </ RectangleGeometry > </ Image.Clip > </ Image > </ Canvas > * This source code was highlighted with Source Code Highlighter .
< Canvas x:Name ="LayoutRoot" Background ="Yellow" > < Image Source ="Images/ultima.png" Name ="testImage" Height ="50" Width ="405" Canvas . Left ="0" Canvas . Top ="30" > < Image.Clip > < RectangleGeometry Rect ="0,0,45,50" x:Name ="tempRectangle" > </ RectangleGeometry > </ Image.Clip > </ Image > </ Canvas > * This source code was highlighted with Source Code Highlighter .
< Canvas x:Name ="LayoutRoot" Background ="Yellow" > < Image Source ="Images/ultima.png" Name ="testImage" Height ="50" Width ="405" Canvas . Left ="0" Canvas . Top ="30" > < Image.Clip > < RectangleGeometry Rect ="0,0,45,50" x:Name ="tempRectangle" > </ RectangleGeometry > </ Image.Clip > </ Image > </ Canvas > * This source code was highlighted with Source Code Highlighter .
< Canvas x:Name ="LayoutRoot" Background ="Yellow" > < Image Source ="Images/ultima.png" Name ="testImage" Height ="50" Width ="405" Canvas . Left ="0" Canvas . Top ="30" > < Image.Clip > < RectangleGeometry Rect ="0,0,45,50" x:Name ="tempRectangle" > </ RectangleGeometry > </ Image.Clip > </ Image > </ Canvas > * This source code was highlighted with Source Code Highlighter .
< Canvas x:Name ="LayoutRoot" Background ="Yellow" > < Image Source ="Images/ultima.png" Name ="testImage" Height ="50" Width ="405" Canvas . Left ="0" Canvas . Top ="30" > < Image.Clip > < RectangleGeometry Rect ="0,0,45,50" x:Name ="tempRectangle" > </ RectangleGeometry > </ Image.Clip > </ Image > </ Canvas > * This source code was highlighted with Source Code Highlighter .
< Canvas x:Name ="LayoutRoot" Background ="Yellow" > < Image Source ="Images/ultima.png" Name ="testImage" Height ="50" Width ="405" Canvas . Left ="0" Canvas . Top ="30" > < Image.Clip > < RectangleGeometry Rect ="0,0,45,50" x:Name ="tempRectangle" > </ RectangleGeometry > </ Image.Clip > </ Image > </ Canvas > * This source code was highlighted with Source Code Highlighter .
< Canvas x:Name ="LayoutRoot" Background ="Yellow" > < Image Source ="Images/ultima.png" Name ="testImage" Height ="50" Width ="405" Canvas . Left ="0" Canvas . Top ="30" > < Image.Clip > < RectangleGeometry Rect ="0,0,45,50" x:Name ="tempRectangle" > </ RectangleGeometry > </ Image.Clip > </ Image > </ Canvas > * This source code was highlighted with Source Code Highlighter .
* This source code was highlighted with Source Code Highlighter .
- private Timer t;
- private Int32 i = 0;
* This source code was highlighted with Source Code Highlighter .
- namespace SilverLightDrawing
- {
- public partial class Page : UserControl
- {
- private Timer t;
- private Int32 i = 0;
- public page ()
- {
- Initializecomponent ();
- t = new Timer (ShowAnimation, null , 3000, 100);
- }
- private void ShowAnimation ( object state)
- {
- i + = 45;
- if (i> 400)
- {
- i = 0;
- }
- LayoutRoot.Dispatcher.BeginInvoke ( delegate ()
- {
- Canvas.SetLeft (testImage, -i);
- tempRectangle.Rect = new Rect (i, 0, 45, 50);
- });
- }
- }
- }
Source: https://habr.com/ru/post/46197/
All Articles