A Swiss Army knife for developers.
C# blazorcross-platformcsharpdesktopdesktop-appdesktop-applicationdeveloper-toolsextensiblefluentfluent-designlinuxmacosmicasyntax-highlightingtypescriptwindowswindows-10windows-11winui
Added Grid component
Etienne Baudouxc4e7c87fa5af
diff --git a/src/app/dev/DevToys.Blazor/Components/Layout/Container/Container.razor b/src/app/dev/DevToys.Blazor/Components/Layout/Container/Container.razorindex b882b3d71..883449896 100644--- a/src/app/dev/DevToys.Blazor/Components/Layout/Container/Container.razor+++ b/src/app/dev/DevToys.Blazor/Components/Layout/Container/Container.razor@@ -3,7 +3,7 @@<CascadingValue Value="this" IsFixed="true"><div class="@(FinalCssClasses)"- style="@(Style);@(FinalStyles)"+ style="@(FinalStyles)"@attributes="AdditionalAttributes"><div style="@(FinalInnerStyles)">@ChildContentdiff --git a/src/app/dev/DevToys.Blazor/Components/Layout/Grid/Grid.razor b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/Grid.razornew file mode 100644index 000000000..08c518b2f--- /dev/null+++ b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/Grid.razor@@ -0,0 +1,12 @@+@namespace DevToys.Blazor.Components+@inherits StyledComponentBase++<Container HorizontalAlignment="@HorizontalAlignment"+ VerticalAlignment="@VerticalAlignment"+ Width="@Width"+ Height="@Height"+ IsVisible="@IsVisible">+ <div id="@Id" @ref="@Element" class="@FinalCssClasses" style="@StyleValue" @attributes="AdditionalAttributes">+ @ChildContent+ </div>+</Container>\ No newline at end of filediff --git a/src/app/dev/DevToys.Blazor/Components/Layout/Grid/Grid.razor.cs b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/Grid.razor.csnew file mode 100644index 000000000..76057442a--- /dev/null+++ b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/Grid.razor.cs@@ -0,0 +1,78 @@+using System.ComponentModel.DataAnnotations;+using System.Text;++namespace DevToys.Blazor.Components;++public partial class Grid : StyledComponentBase+{+ protected string? StyleValue => new StyleBuilder()+ .AddStyle("display", "grid")+ .AddStyle("grid-template-columns", GetGridTemplate(Columns))+ .AddStyle("grid-template-rows", GetGridTemplate(Rows))+ .AddStyle("gap", $"{RowSpacing.ToPx()} {ColumnSpacing.ToPx()}")+ .AddStyle(Style)+ .Build();++ /// <summary>+ /// Gets or sets the list of columns in the grid.+ /// </summary>+ [Parameter]+ public IEnumerable<GridLength>? Columns { get; set; }++ /// <summary>+ /// Gets or sets the list of rows in the grid.+ /// </summary>+ [Parameter]+ public IEnumerable<GridLength>? Rows { get; set; }++ /// <summary>+ /// Gets or sets the uniform distance (in pixels) between grid columns.+ /// </summary>+ [Parameter]+ [Range(0, int.MaxValue, ErrorMessage = $"{nameof(ColumnSpacing)} must be positive and zero-based.")]+ public int ColumnSpacing { get; set; }++ /// <summary>+ /// Gets or sets the uniform distance (in pixels) between grid rows.+ /// </summary>+ [Parameter]+ [Range(0, int.MaxValue, ErrorMessage = $"{nameof(RowSpacing)} must be positive and zero-based.")]+ public int RowSpacing { get; set; }++ /// <summary>+ /// Gets or sets the content to be rendered inside the component.+ /// </summary>+ [Parameter]+ public RenderFragment? ChildContent { get; set; }++ private static string GetGridTemplate(IEnumerable<GridLength>? collection)+ {+ if (collection is null || !collection.Any())+ {+ return "1fr";+ }++ var builder = new StringBuilder();+ foreach (GridLength item in collection)+ {+ if (item.IsFraction)+ {+ builder.Append($" {item.Value}fr");+ }+ else if (item.IsAbsolute)+ {+ builder.Append($" {item.Value.ToPx()}");+ }+ else if (item.IsAuto)+ {+ builder.Append($" auto");+ }+ else+ {+ ThrowHelper.ThrowNotSupportedException();+ }+ }++ return builder.ToString();+ }+}diff --git a/src/app/dev/DevToys.Blazor/Components/Layout/Grid/Grid.razor.scss b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/Grid.razor.scssnew file mode 100644index 000000000..e69de29bbdiff --git a/src/app/dev/DevToys.Blazor/Components/Layout/Grid/GridCell.razor b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/GridCell.razornew file mode 100644index 000000000..ef01fa704--- /dev/null+++ b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/GridCell.razor@@ -0,0 +1,8 @@+@namespace DevToys.Blazor.Components+@inherits ComponentBase++<Container HorizontalAlignment="@HorizontalAlignment.Stretch"+ VerticalAlignment="@VerticalAlignment.Stretch"+ Style="@GridCellStyleValue">+ @ChildContent+</Container>\ No newline at end of filediff --git a/src/app/dev/DevToys.Blazor/Components/Layout/Grid/GridCell.razor.cs b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/GridCell.razor.csnew file mode 100644index 000000000..dfcc0ec26--- /dev/null+++ b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/GridCell.razor.cs@@ -0,0 +1,47 @@+using System.ComponentModel.DataAnnotations;++namespace DevToys.Blazor.Components;++public partial class GridCell : ComponentBase+{+ protected string? GridCellStyleValue => new StyleBuilder()+ .AddStyle("grid-column", $"{Column + 1}", ColumnSpan == 1)+ .AddStyle("grid-row", $"{Row + 1}", RowSpan == 1)+ .AddStyle("grid-column", $"{Column + 1} / span {ColumnSpan}", ColumnSpan > 1)+ .AddStyle("grid-row", $"{Row + 1} / span {RowSpan}", RowSpan > 1)+ .Build();++ /// <summary>+ /// Gets or sets the column alignment of an element when child layout is processed by a parent <see cref="Grid"/> layout container.+ /// </summary>+ [Parameter]+ [Range(0, int.MaxValue, ErrorMessage = $"{nameof(Column)} must be positive and zero-based.")]+ public int Column { get; set; }++ /// <summary>+ /// Gets or sets the row alignment of an element when child layout is processed by a parent <see cref="Grid"/> layout container.+ /// </summary>+ [Parameter]+ [Range(0, int.MaxValue, ErrorMessage = $"{nameof(Row)} must be positive and zero-based.")]+ public int Row { get; set; }++ /// <summary>+ /// Gets or sets a value that indicates the total number of columns that the element content spans within a parent <see cref="Grid"/>.+ /// </summary>+ [Parameter]+ [Range(1, int.MaxValue, ErrorMessage = $"{nameof(ColumnSpan)} must be greater or equal to 1.")]+ public int ColumnSpan { get; set; } = 1;++ /// <summary>+ /// Gets or sets a value that indicates the total number of rows that the element content spans within a parent <see cref="Grid"/>.+ /// </summary>+ [Parameter]+ [Range(1, int.MaxValue, ErrorMessage = $"{nameof(RowSpan)} must be greater or equal to 1.")]+ public int RowSpan { get; set; } = 1;++ /// <summary>+ /// Gets or sets the content to be rendered inside the component.+ /// </summary>+ [Parameter]+ public RenderFragment? ChildContent { get; set; }+}diff --git a/src/app/dev/DevToys.Blazor/Components/Layout/Grid/GridLength.cs b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/GridLength.csnew file mode 100644index 000000000..d427503d5--- /dev/null+++ b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/GridLength.cs@@ -0,0 +1,130 @@+namespace DevToys.Blazor.Components;++public readonly struct GridLength : IEquatable<GridLength>+{+ private readonly GridUnitType _type;++ private readonly double _value;++ /// <summary>+ /// Initializes a new instance of the <see cref="GridLength"/> struct.+ /// </summary>+ /// <param name="value">The size of the GridLength in device independent pixels.</param>+ public GridLength(double value)+ : this(value, GridUnitType.Pixel)+ {+ }++ /// <summary>+ /// Initializes a new instance of the <see cref="GridLength"/> struct.+ /// </summary>+ /// <param name="value">The size of the <see cref="GridLength"/>.</param>+ /// <param name="type">The unit of the <see cref="GridLength"/>.</param>+ public GridLength(double value, GridUnitType type)+ {+ if (value < 0 || double.IsNaN(value) || double.IsInfinity(value))+ {+ throw new ArgumentException("Invalid value", nameof(value));+ }++ if (type < GridUnitType.Auto || type > GridUnitType.Fraction)+ {+ throw new ArgumentException("Invalid value", nameof(type));+ }++ _type = type;+ _value = value;+ }++ /// <summary>+ /// Gets an instance of <see cref="GridLength"/> that indicates that a row or column should+ /// auto-size to fit its content.+ /// </summary>+ public static GridLength Auto => new(0, GridUnitType.Auto);++ /// <summary>+ /// Gets the unit of the <see cref="GridLength"/>.+ /// </summary>+ public GridUnitType GridUnitType => _type;++ /// <summary>+ /// Gets a value that indicates whether the <see cref="GridLength"/> has a <see cref="GridUnitType"/> of Pixel.+ /// </summary>+ public bool IsAbsolute => _type == GridUnitType.Pixel;++ /// <summary>+ /// Gets a value that indicates whether the <see cref="GridLength"/> has a <see cref="GridUnitType"/> of Auto.+ /// </summary>+ public bool IsAuto => _type == GridUnitType.Auto;++ /// <summary>+ /// Gets a value that indicates whether the <see cref="GridLength"/> has a <see cref="GridUnitType"/> of Fraction.+ /// </summary>+ public bool IsFraction => _type == GridUnitType.Fraction;++ /// <summary>+ /// Gets the length.+ /// </summary>+ public double Value => _value;++ /// <summary>+ /// Compares two <see cref="GridLength"/> structures for equality.+ /// </summary>+ /// <param name="a">The first <see cref="GridLength"/>.</param>+ /// <param name="b">The second <see cref="GridLength"/>.</param>+ /// <returns>True if the structures are equal, otherwise false.</returns>+ public static bool operator ==(GridLength a, GridLength b)+ {+ return (a.IsAuto && b.IsAuto) || (a._value == b._value && a._type == b._type);+ }++ /// <summary>+ /// Compares two <see cref="GridLength"/> structures for inequality.+ /// </summary>+ /// <param name="gl1">The first <see cref="GridLength"/>.</param>+ /// <param name="gl2">The first <see cref="GridLength"/>.</param>+ /// <returns>True if the structures are unequal, otherwise false.</returns>+ public static bool operator !=(GridLength gl1, GridLength gl2)+ {+ return !(gl1 == gl2);+ }++ /// <summary>+ /// Determines whether the <see cref="GridLength"/> is equal to the specified object.+ /// </summary>+ /// <param name="o">The object with which to test equality.</param>+ /// <returns>True if the objects are equal, otherwise false.</returns>+ public override bool Equals(object? o)+ {+ if (o == null)+ {+ return false;+ }++ if (o is not GridLength)+ {+ return false;+ }++ return this == (GridLength)o;+ }++ /// <summary>+ /// Compares two <see cref="GridLength"/> structures for equality.+ /// </summary>+ /// <param name="gridLength">The structure with which to test equality.</param>+ /// <returns>True if the structures are equal, otherwise false.</returns>+ public bool Equals(GridLength gridLength)+ {+ return this == gridLength;+ }++ /// <summary>+ /// Gets a hash code for the <see cref="GridLength"/>.+ /// </summary>+ /// <returns>The hash code.</returns>+ public override int GetHashCode()+ {+ return _value.GetHashCode() ^ _type.GetHashCode();+ }+}diff --git a/src/app/dev/DevToys.Blazor/Components/Layout/Grid/GridUnitType.cs b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/GridUnitType.csnew file mode 100644index 000000000..d5278c1c4--- /dev/null+++ b/src/app/dev/DevToys.Blazor/Components/Layout/Grid/GridUnitType.cs@@ -0,0 +1,19 @@+namespace DevToys.Blazor.Components;++public enum GridUnitType+{+ /// <summary>+ /// The row or column is auto-sized to fit its content.+ /// </summary>+ Auto = 0,++ /// <summary>+ /// The row or column is sized in device independent pixels.+ /// </summary>+ Pixel = 1,++ /// <summary>+ /// The row or column is sized as a weighted proportion of available space.+ /// </summary>+ Fraction = 2,+}diff --git a/src/app/dev/DevToys.Blazor/Components/Layout/StackPanel/StackPanel.razor.cs b/src/app/dev/DevToys.Blazor/Components/Layout/StackPanel/StackPanel.razor.csindex 58ee8afeb..356d7c6f8 100644--- a/src/app/dev/DevToys.Blazor/Components/Layout/StackPanel/StackPanel.razor.cs+++ b/src/app/dev/DevToys.Blazor/Components/Layout/StackPanel/StackPanel.razor.cs@@ -1,48 +1,4 @@-// Remember to replace the namespace below with your own project's namespace..--namespace DevToys.Blazor.Components;--/// <summary>-/// Determines the horizontal alignment of the content within the <see cref="StackPanel"/>.-/// </summary>-public enum StackHorizontalAlignment-{- /// <summary>- /// The content is aligned to the left.- /// </summary>- Left,-- /// <summary>- /// The content is center aligned.- /// </summary>- Center,-- /// <summary>- /// The content is aligned to the right.- /// </summary>- Right,-}--/// <summary>-/// Determines the vertical alignment of the content within the <see cref="StackPanel"/>.-/// </summary>-public enum StackVerticalAlignment-{- /// <summary>- /// The content is aligned to the top.- /// </summary>- Top,-- /// <summary>- /// The content is center aligned.- /// </summary>- Center,-- /// <summary>- /// The content is aligned to the bottom- /// </summary>- Bottom,-}+namespace DevToys.Blazor.Components;public partial class StackPanel : StyledComponentBase{@@ -58,18 +14,6 @@ public partial class StackPanel : StyledComponentBase.AddStyle(Style).Build();- /// <summary>- /// The horizontal alignment of the components in the stack.- /// </summary>- [Parameter]- public StackHorizontalAlignment ContentHorizontalAlignment { get; set; } = StackHorizontalAlignment.Left;-- /// <summary>- /// The vertical alignment of the components in the stack.- /// </summary>- [Parameter]- public StackVerticalAlignment ContentVerticalAlignment { get; set; } = StackVerticalAlignment.Top;-/// <summary>/// Gets or set the orientation of the stacked components./// </summary>@@ -99,26 +43,4 @@ public partial class StackPanel : StyledComponentBase/// </summary>[Parameter]public RenderFragment? ChildContent { get; set; }-- private string GetHorizontalAlignment()- {- return ContentHorizontalAlignment switch- {- StackHorizontalAlignment.Left => "start",- StackHorizontalAlignment.Center => "center",- StackHorizontalAlignment.Right => "end",- _ => "start",- };- }-- private string GetVerticalAlignment()- {- return ContentVerticalAlignment switch- {- StackVerticalAlignment.Top => "start",- StackVerticalAlignment.Center => "center",- StackVerticalAlignment.Bottom => "end",- _ => "start",- };- }}diff --git a/src/app/dev/DevToys.Blazor/Pages/Index.razor b/src/app/dev/DevToys.Blazor/Pages/Index.razorindex 61d3187ee..573ecf0bf 100644--- a/src/app/dev/DevToys.Blazor/Pages/Index.razor+++ b/src/app/dev/DevToys.Blazor/Pages/Index.razor@@ -89,80 +89,99 @@{<div class="entranceThemeTransition" style="display: contents"><ScrollViewer>- <StackPanel Orientation="Orientation.Vertical" HorizontalAlignment="HorizontalAlignment.Stretch">- <TextBlock Appearance="TextBlockAppearance.TitleLarge" Text="@guiToolViewItem.ToolInstance.LongOrShortDisplayTitle" />- <!-- TODO: Place here a component that takes in argument the guiToolViewItem -->+ <Grid ColumnSpacing="12"+ RowSpacing="12"+ Columns="@(new List<GridLength>+ {+ GridLength.Auto,+ new GridLength(1, GridUnitType.Fraction),+ new GridLength(250)+ })">- <MonacoEditor />- <Button VerticalAlignment="VerticalAlignment.Center" IsEnabled="true" @onclick="OnSetFavorite">Set favorite</Button>- <Button HorizontalAlignment="HorizontalAlignment.Left" IsEnabled="false">Set favorite</Button>- <Button HorizontalAlignment="HorizontalAlignment.Center" IsEnabled="true" Appearance="ButtonAppearance.Accent">Set favorite</Button>- <Button HorizontalAlignment="HorizontalAlignment.Right" Height="100" Width="200" IsEnabled="false" Appearance="ButtonAppearance.Accent">Set favorite</Button>- <Button IsEnabled="true" Appearance="ButtonAppearance.Stealth">Set favorite</Button>- <Button VerticalAlignment="VerticalAlignment.Bottom" IsEnabled="false" Appearance="ButtonAppearance.Stealth">Set favorite</Button>- <ProgressRing IsIndeterminate="true" />- <ProgressRing Value="75" Size="32" />- <TextBox Header="First name" Placeholder="Normal" Style="margin-top: 12px; margin-left: 8px; margin-right: 8px;" />- <TextBox Header="Middle name" Placeholder="Read only" IsReadOnly="true" Style="margin-top: 12px; margin-left: 8px; margin-right: 8px;" />- <TextBox Header="Last name" Placeholder="Disabled" IsEnabled="false" Style="margin-top: 12px; margin-left: 8px; margin-right: 8px;" />- <ProgressBar IsIndeterminate="true" Width="150" HorizontalAlignment="HorizontalAlignment.Left" />- <ProgressBar Value="75" />- <CheckBox IsChecked="true" Text="An option" />- <CheckBox IsChecked="true" IsEnabled="false" Text="An option" />- <CheckBox IsChecked="false" IsEnabled="false" Text="An option" />- <DropDownList Header="Drop down list header"- Items="@(new List<DropDownListItem>- {- new DropDownListItem { Text = "Item 1", IconGlyph = '\uE670' },- new DropDownListItem { Text = "Item 2" },- new DropDownListItem { Text = "Item 3" },- new DropDownListItem { Text = "Item 4" },- new DropDownListItem { Text = "Item 5" },- new DropDownListItem { Text = "Item 6" },- new DropDownListItem { Text = "Item 7" },- new DropDownListItem { Text = "Item 8" },- new DropDownListItem { Text = "Item 9" },- new DropDownListItem { Text = "Item 10" },- new DropDownListItem { Text = "Item 11" },- new DropDownListItem { Text = "Item 12" },- new DropDownListItem { Text = "Item 13" },- new DropDownListItem { Text = "Item 14" },- new DropDownListItem { Text = "Item 15 - longer text" }- })">- <TextBlock Appearance="TextBlockAppearance.Body" Text="Click me!" />- </DropDownList>- <ToggleSwitch IsOn="true" Text="An option" />- <ToggleSwitch IsOn="true" IsEnabled="false" Text="An option" />- <ToggleSwitch IsOn="false" IsEnabled="false" Text="An option" />- <RadioButton Text="Option 1" Group="Group1"/>- <RadioButton Text="Option 2" Group="Group1"/>- <RadioButton Text="Option 3" Group="Group1"/>- <RadioButton Text="Option 4" Group="Group1" IsEnabled="false"/>- <ComboBox Items="@(new List<string>- {- "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9", "Item 10",- "Item 11", "Item 12", "Item 13", "Item 14", "Item 15", "Item 16 - longer text"- })"- Context="item"- @bind-SelectedIndex="@ComboBoxSelectedItem"- Header="ComboBox header"- HorizontalAlignment="HorizontalAlignment.Left">- <ItemTemplate>- @item- </ItemTemplate>- </ComboBox>- <ListBox Items="@(new List<string>- {- "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9", "Item 10",- "Item 11", "Item 12", "Item 13", "Item 14", "Item 15", "Item 16 - longer text"- })"- Context="item"- SelectedIndex="1">- <ItemTemplate>- @item- </ItemTemplate>- </ListBox>- </StackPanel>+ <GridCell Column="0">+ <StackPanel Orientation="Orientation.Vertical">+ <ProgressRing IsIndeterminate="true" />+ <ProgressRing Value="75" Size="32" />+ <CheckBox IsChecked="true" Text="An option" />+ <CheckBox IsChecked="true" IsEnabled="false" Text="An option" />+ <CheckBox IsChecked="false" IsEnabled="false" Text="An option" />+ <ToggleSwitch IsOn="true" Text="An option" />+ <ToggleSwitch IsOn="true" IsEnabled="false" Text="An option" />+ <ToggleSwitch IsOn="false" IsEnabled="false" Text="An option" />+ <StackPanel>+ <RadioButton Text="Option 1" Group="Group1" />+ <RadioButton Text="Option 2" Group="Group1" />+ <RadioButton Text="Option 3" Group="Group1" />+ <RadioButton Text="Option 4" Group="Group1" IsEnabled="false" />+ </StackPanel>+ </StackPanel>+ </GridCell>++ <GridCell Column="1" ColumnSpan="2">+ <StackPanel Orientation="Orientation.Vertical">+ <TextBlock Appearance="TextBlockAppearance.TitleLarge" Text="@guiToolViewItem.ToolInstance.LongOrShortDisplayTitle" />+ <!-- TODO: Place here a component that takes in argument the guiToolViewItem -->++ <MonacoEditor />+ <Button VerticalAlignment="VerticalAlignment.Center" IsEnabled="true" @onclick="OnSetFavorite">Set favorite</Button>+ <Button HorizontalAlignment="HorizontalAlignment.Left" IsEnabled="false">Set favorite</Button>+ <Button HorizontalAlignment="HorizontalAlignment.Center" IsEnabled="true" Appearance="ButtonAppearance.Accent">Set favorite</Button>+ <Button HorizontalAlignment="HorizontalAlignment.Right" Height="100" Width="200" IsEnabled="false" Appearance="ButtonAppearance.Accent">Set favorite</Button>+ <Button IsEnabled="true" Appearance="ButtonAppearance.Stealth">Set favorite</Button>+ <Button VerticalAlignment="VerticalAlignment.Bottom" IsEnabled="false" Appearance="ButtonAppearance.Stealth">Set favorite</Button>+ <TextBox Header="First name" Placeholder="Normal" Style="margin-top: 12px; margin-left: 8px; margin-right: 8px;" />+ <TextBox Header="Middle name" Placeholder="Read only" IsReadOnly="true" Style="margin-top: 12px; margin-left: 8px; margin-right: 8px;" />+ <TextBox Header="Last name" Placeholder="Disabled" IsEnabled="false" Style="margin-top: 12px; margin-left: 8px; margin-right: 8px;" />+ <ProgressBar IsIndeterminate="true" Width="150" HorizontalAlignment="HorizontalAlignment.Left" />+ <ProgressBar Value="75" />+ <DropDownList Header="Drop down list header"+ Items="@(new List<DropDownListItem>+ {+ new DropDownListItem { Text = "Item 1", IconGlyph = '\uE670' },+ new DropDownListItem { Text = "Item 2" },+ new DropDownListItem { Text = "Item 3" },+ new DropDownListItem { Text = "Item 4" },+ new DropDownListItem { Text = "Item 5" },+ new DropDownListItem { Text = "Item 6" },+ new DropDownListItem { Text = "Item 7" },+ new DropDownListItem { Text = "Item 8" },+ new DropDownListItem { Text = "Item 9" },+ new DropDownListItem { Text = "Item 10" },+ new DropDownListItem { Text = "Item 11" },+ new DropDownListItem { Text = "Item 12" },+ new DropDownListItem { Text = "Item 13" },+ new DropDownListItem { Text = "Item 14" },+ new DropDownListItem { Text = "Item 15 - longer text" }+ })">+ <TextBlock Appearance="TextBlockAppearance.Body" Text="Click me!" />+ </DropDownList>+ <ComboBox Items="@(new List<string>+ {+ "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9", "Item 10",+ "Item 11", "Item 12", "Item 13", "Item 14", "Item 15", "Item 16 - longer text"+ })"+ Context="item"+ @bind-SelectedIndex="@ComboBoxSelectedItem"+ Header="ComboBox header"+ HorizontalAlignment="HorizontalAlignment.Left">+ <ItemTemplate>+ @item+ </ItemTemplate>+ </ComboBox>+ <ListBox Items="@(new List<string>+ {+ "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9", "Item 10",+ "Item 11", "Item 12", "Item 13", "Item 14", "Item 15", "Item 16 - longer text"+ })"+ Context="item"+ SelectedIndex="1">+ <ItemTemplate>+ @item+ </ItemTemplate>+ </ListBox>+ </StackPanel>+ </GridCell>+ </Grid></ScrollViewer></div>}