summaryrefslogtreecommitdiff
path: root/ElmSharp.Test/TC/ImageTest1.cs
blob: de8f72be7a4c0a9271c410e2e52ef612e34fb6e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.IO;
using ElmSharp;
using System.Collections.Generic;

namespace ElmSharp.Test
{
    public class ImageTest1 : TestCaseBase
    {
        public override string TestName => "ImageTest1";
        public override string TestDescription => "To test basic operation of Image";

        public override void Run(Window window)
        {
            Image image = new Image(window)
            {
                IsFixedAspect = false
            };
            image.Load(Path.Combine(TestRunner.ResourceDir,  "picture.png"));
            image.Clicked += (e, o) =>
            {
                Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect);
                image.IsFixedAspect = image.IsFixedAspect == true?false:true;
            };

            image.Show();
            image.Resize(500, 500);
            image.Move(100,100);
        }
    }
}