IViewAware.cs 907 B

12345678910111213141516171819202122232425262728
  1. namespace Caliburn.Micro.Core {
  2. using System;
  3. /// <summary>
  4. /// Denotes a class which is aware of its view(s).
  5. /// </summary>
  6. public interface IViewAware {
  7. /// <summary>
  8. /// Attaches a view to this instance.
  9. /// </summary>
  10. /// <param name="view">The view.</param>
  11. /// <param name="context">The context in which the view appears.</param>
  12. void AttachView(object view, object context = null);
  13. /// <summary>
  14. /// Gets a view previously attached to this instance.
  15. /// </summary>
  16. /// <param name="context">The context denoting which view to retrieve.</param>
  17. /// <returns>The view.</returns>
  18. object GetView(object context = null);
  19. /// <summary>
  20. /// Raised when a view is attached.
  21. /// </summary>
  22. event EventHandler<ViewAttachedEventArgs> ViewAttached;
  23. }
  24. }