forked from gui-cs/Terminal.Gui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gui-cs#3575 from tig/v2_3522-IDesignable
Fixes gui-cs#3522. Adds `IDesignable`: Ability for Views to load design-time/demo data
- Loading branch information
Showing
11 changed files
with
279 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace Terminal.Gui; | ||
|
||
/// <summary> | ||
/// Interface declaring common functionality useful for designer implementations. | ||
/// </summary> | ||
public interface IDesignable | ||
{ | ||
/// <summary> | ||
/// Causes the View to enable design-time mode. This typically means that the view will load demo data and | ||
/// be configured to allow for design-time manipulation. | ||
/// </summary> | ||
/// <param name="context">Optional arbitrary, View-specific, context.</param> | ||
/// <typeparam name="TContext">A non-null type for <paramref name="context"/>.</typeparam> | ||
/// <returns><see langword="true"/> if the view successfully loaded demo data.</returns> | ||
public bool EnableForDesign<TContext> (ref readonly TContext context) where TContext : notnull => EnableForDesign (); | ||
|
||
/// <summary> | ||
/// Causes the View to enable design-time mode. This typically means that the view will load demo data and | ||
/// be configured to allow for design-time manipulation. | ||
/// </summary> | ||
/// <returns><see langword="true"/> if the view successfully loaded demo data.</returns> | ||
public bool EnableForDesign () => false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.