diff --git a/Bloxstrap/Resources/CustomBootstrapperSchema.json b/Bloxstrap/Resources/CustomBootstrapperSchema.json index 3558700..b74f1f6 100644 --- a/Bloxstrap/Resources/CustomBootstrapperSchema.json +++ b/Bloxstrap/Resources/CustomBootstrapperSchema.json @@ -133,6 +133,13 @@ "ColumnDefinitions": "object" } }, + "StackPanel": { + "SuperClass": "FrameworkElement", + "IsCreatable": true, + "Attributes": { + "Orientation": "Orientation" + } + }, "RowDefinition": { "IsCreatable": true, "Attributes": { @@ -483,6 +490,12 @@ "Performance", "Quality" ] + }, + "Orientation": { + "Values": [ + "Horizontal", + "Vertical" + ] } } } \ No newline at end of file diff --git a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs index ca5b473..3b682a7 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs +++ b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs @@ -31,6 +31,7 @@ namespace Bloxstrap.UI.Elements.Bootstrapper ["MarkdownTextBlock"] = HandleXmlElement_MarkdownTextBlock, ["Image"] = HandleXmlElement_Image, ["Grid"] = HandleXmlElement_Grid, + ["StackPanel"] = HandleXmlElement_StackPanel, ["SolidColorBrush"] = HandleXmlElement_SolidColorBrush, ["ImageBrush"] = HandleXmlElement_ImageBrush, diff --git a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Elements.cs b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Elements.cs index 6576e15..f2c9bca 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Elements.cs +++ b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Elements.cs @@ -713,6 +713,22 @@ namespace Bloxstrap.UI.Elements.Bootstrapper return grid; } + + private static StackPanel HandleXmlElement_StackPanel(CustomDialog dialog, XElement xmlElement) + { + var stackPanel = new StackPanel(); + HandleXmlElement_FrameworkElement(dialog, stackPanel, xmlElement); + + stackPanel.Orientation = ParseXmlAttribute(xmlElement, "Orientation", Orientation.Vertical); + + foreach (var element in xmlElement.Elements()) + { + var uiElement = HandleXml(dialog, element); + stackPanel.Children.Add(uiElement); + } + + return stackPanel; + } #endregion } }