Vixen
dd8b0a81

InjectDirectiveSyntax

class
csharp
public sealed class InjectDirectiveSyntax

@inject ITheme Theme — the property that reads an ambient value.

Read the guide page for this →

Remarks

⚠ Sugar over one line of code-behind, and the mirror of <provide>. It generates private ITheme? Theme => Inject<ITheme>(); and nothing else, so the property is nullable because injection can find nothing — a consumer that needs a fallback still writes the ?? Default in @code. Repeatable, like @using and unlike every other header, because the shape it is for is a file that reads three ambient values.

Fields and properties (3)

  • public SyntaxToken InjectKeyword
  • public SyntaxToken Type

    The ambient key, dotted, carried whole as one token.

  • public SyntaxToken Name

    What the generated property is called.

Methods (7)

Used by (9)

  • BinderVixen.Ui.Markup
  • DocumentSyntaxVixen.Ui.Markup
  • InjectDirectiveSyntaxVixen.Ui.Markup
  • ParserTestsVixen.Ui.Markup.Tests
  • SyntaxFactoryVixen.Ui.Markup
  • SyntaxRewriterVixen.Ui.Markup
  • SyntaxVisitorVixen.Ui.Markup
  • SyntaxVisitorVixen.Ui.Markup
  • VxmlParserVixen.Ui.Markup