2 using Tizen.NUI.BaseComponents;
3 using Tizen.NUI.Components;
5 namespace Tizen.NUI.Samples
7 public class PropertyNotificationTest : IExample
11 public void Activate()
13 win = NUIApplication.GetDefaultWindow();
14 win.BackgroundColor = Color.White;
16 View view = new View()
18 Size = new Size(100, 100),
19 BackgroundColor = Color.Red,
23 PropertyNotification propertyNotification = view.AddPropertyNotification("size", PropertyCondition.Step(1.0f));
25 propertyNotification.Notified += (object source, PropertyNotification.NotifyEventArgs args) =>
27 View target = args.PropertyNotification.GetTarget() as View;
30 Tizen.Log.Error("NUI", $"Size changed! ({target.SizeWidth},{target.SizeHeight})");
31 global::System.Console.WriteLine($"Size changed! ({target.SizeWidth},{target.SizeHeight})");
33 Tizen.Log.Error("NUI", "Size changed");
36 Button button = new Button()
38 Size = new Size(100, 100),
39 Position = new Position(200, 200),
44 button.Clicked += (object source, ClickedEventArgs args) =>
48 view.Size += new Size(5, 5);
52 view.Position += new Position(10, 10);
56 win.GetDefaultLayer().Add(view);
57 win.GetDefaultLayer().Add(button);
60 public void Deactivate()
62 win.GetDefaultLayer().FindChildByName("test view")?.Unparent();
63 win.GetDefaultLayer().FindChildByName("test button")?.Unparent();