IDesignable.cs 1.1 KB

1234567891011121314151617181920212223
  1. namespace Terminal.Gui;
  2. /// <summary>
  3. /// Interface declaring common functionality useful for designer implementations.
  4. /// </summary>
  5. public interface IDesignable
  6. {
  7. /// <summary>
  8. /// Causes the View to enable design-time mode. This typically means that the view will load demo data and
  9. /// be configured to allow for design-time manipulation.
  10. /// </summary>
  11. /// <param name="context">Optional arbitrary, View-specific, context.</param>
  12. /// <typeparam name="TContext">A non-null type for <paramref name="context"/>.</typeparam>
  13. /// <returns><see langword="true"/> if the view successfully loaded demo data.</returns>
  14. public bool EnableForDesign<TContext> (ref readonly TContext context) where TContext : notnull => EnableForDesign ();
  15. /// <summary>
  16. /// Causes the View to enable design-time mode. This typically means that the view will load demo data and
  17. /// be configured to allow for design-time manipulation.
  18. /// </summary>
  19. /// <returns><see langword="true"/> if the view successfully loaded demo data.</returns>
  20. public bool EnableForDesign () => false;
  21. }