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,17 +706,19 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
|
|||||||
return GetTranslatedText(contentAttr.Value);
|
return GetTranslatedText(contentAttr.Value);
|
||||||
|
|
||||||
var contentElement = xmlElement.Element($"{xmlElement.Name}.Content");
|
var contentElement = xmlElement.Element($"{xmlElement.Name}.Content");
|
||||||
if (contentElement != null)
|
if (contentElement == null)
|
||||||
{
|
return null;
|
||||||
var first = contentElement.FirstNode as XElement;
|
|
||||||
if (first == null)
|
|
||||||
throw new Exception($"{xmlElement.Name} Content is missing the content");
|
|
||||||
|
|
||||||
var uiElement = HandleXml<UIElement>(dialog, first);
|
var children = contentElement.Elements();
|
||||||
return uiElement;
|
if (children.Count() > 1)
|
||||||
}
|
throw new Exception($"{xmlElement.Name}.Content can only have one child");
|
||||||
|
|
||||||
return null;
|
var first = contentElement.FirstNode as XElement;
|
||||||
|
if (first == null)
|
||||||
|
throw new Exception($"{xmlElement.Name} Content is missing the content");
|
||||||
|
|
||||||
|
var uiElement = HandleXml<UIElement>(dialog, first);
|
||||||
|
return uiElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static UIElement HandleXmlElement_Button(CustomDialog dialog, XElement xmlElement)
|
private static UIElement HandleXmlElement_Button(CustomDialog dialog, XElement xmlElement)
|
||||||
|
Loading…
Reference in New Issue
Block a user