UrhoAppViewSource.cs 550 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using Windows.ApplicationModel.Core;
  3. using Urho.SharpReality;
  4. namespace Urho
  5. {
  6. public class UrhoAppViewSource<T> : IFrameworkViewSource where T : StereoApplication
  7. {
  8. readonly ApplicationOptions opts;
  9. public event Action<UrhoAppView> UrhoAppViewCreated;
  10. public UrhoAppViewSource() { }
  11. public UrhoAppViewSource(ApplicationOptions opts)
  12. {
  13. this.opts = opts;
  14. }
  15. public IFrameworkView CreateView()
  16. {
  17. var appView = UrhoAppView.Create<T>(opts);
  18. UrhoAppViewCreated?.Invoke(appView);
  19. return appView;
  20. }
  21. }
  22. }