mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
add children check to content
This commit is contained in:
parent
038bd2af1b
commit
d001285e42
@ -706,8 +706,13 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
|
||||
return GetTranslatedText(contentAttr.Value);
|
||||
|
||||
var contentElement = xmlElement.Element($"{xmlElement.Name}.Content");
|
||||
if (contentElement != null)
|
||||
{
|
||||
if (contentElement == null)
|
||||
return null;
|
||||
|
||||
var children = contentElement.Elements();
|
||||
if (children.Count() > 1)
|
||||
throw new Exception($"{xmlElement.Name}.Content can only have one child");
|
||||
|
||||
var first = contentElement.FirstNode as XElement;
|
||||
if (first == null)
|
||||
throw new Exception($"{xmlElement.Name} Content is missing the content");
|
||||
@ -716,9 +721,6 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
|
||||
return uiElement;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static UIElement HandleXmlElement_Button(CustomDialog dialog, XElement xmlElement)
|
||||
{
|
||||
var button = new Button();
|
||||
|
Loading…
Reference in New Issue
Block a user