2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 using System.Collections.Generic;
22 namespace ElmSharp.Test
24 public class EvasImageTest1 : TestCaseBase
26 public override string TestName => "EvasImageTest1";
27 public override string TestDescription => "To test EvasImage proxy feature";
29 public override void Run(Window window)
31 Conformant conformant = new Conformant(window);
33 Box box = new Box(window);
34 conformant.SetContent(box);
37 Box horizentalBox = new Box(window)
47 Button realObject1 = new Button(window) {
48 Text = "It is RealObject",
56 Image realObject2 = new Image(window)
63 realObject2.Load(Path.Combine(TestRunner.ResourceDir, "picture.png"));
66 horizentalBox.PackEnd(realObject1);
67 horizentalBox.PackEnd(realObject2);
69 EvasImage proxyObject = new EvasImage(window)
76 Button toggle = new Button(window)
78 Text = "Change Source",
86 EvasObject proxyedObject = realObject1;
87 toggle.Clicked += (s, e) =>
89 if (proxyedObject == realObject1)
91 proxyedObject = realObject2;
95 proxyedObject = realObject1;
97 proxyObject.SetSource(proxyedObject);
101 proxyObject.IsFilled = true;
102 proxyObject.SetSource(realObject1);
105 box.PackEnd(horizentalBox);
106 box.PackEnd(proxyObject);