EmbedSampleNuiTizen.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Avalonia.Platform;
  7. using Avalonia.Tizen;
  8. using ControlCatalog.Pages;
  9. using Tizen.NUI.BaseComponents;
  10. using Tizen.NUI.Components;
  11. using Tizen.Pims.Contacts.ContactsViews;
  12. namespace ControlCatalog.Tizen;
  13. public class EmbedSampleNuiTizen : INativeDemoControl
  14. {
  15. public IPlatformHandle CreateControl(bool isSecond, IPlatformHandle parent, Func<IPlatformHandle> createDefault)
  16. {
  17. if (isSecond)
  18. {
  19. var webView = new WebView();
  20. webView.LoadUrl("https://avaloniaui.net/");
  21. return new NuiViewControlHandle(webView);
  22. }
  23. else
  24. {
  25. var clickCount = 0;
  26. var button = new Button
  27. {
  28. Text = "Hello world"
  29. };
  30. button.Clicked += (sender, e) =>
  31. {
  32. clickCount++;
  33. button.Text = $"Click count {clickCount}";
  34. };
  35. return new NuiViewControlHandle(button);
  36. }
  37. }
  38. }