MacOSTextBoxFactory.cs 513 B

1234567891011121314151617181920
  1. using System;
  2. using System.Text;
  3. using Avalonia.Platform;
  4. using MonoMac.AppKit;
  5. using MonoMac.WebKit;
  6. namespace IntegrationTestApp.Embedding;
  7. internal class MacOSTextBoxFactory : INativeControlFactory
  8. {
  9. public IPlatformHandle CreateControl(IPlatformHandle parent, Func<IPlatformHandle> createDefault)
  10. {
  11. MacHelper.EnsureInitialized();
  12. var textView = new NSTextView();
  13. textView.TextStorage.Append(new("Native text box"));
  14. return new MacOSViewHandle(textView);
  15. }
  16. }