mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
make sure only one content is defined
This commit is contained in:
parent
d001285e42
commit
88c47cabaa
@ -702,10 +702,13 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
|
||||
private static object? GetContentFromXElement(CustomDialog dialog, XElement xmlElement)
|
||||
{
|
||||
var contentAttr = xmlElement.Attribute("Content");
|
||||
var contentElement = xmlElement.Element($"{xmlElement.Name}.Content");
|
||||
if (contentAttr != null && contentElement != null)
|
||||
throw new Exception($"{xmlElement.Name} can only have one Content defined");
|
||||
|
||||
if (contentAttr != null)
|
||||
return GetTranslatedText(contentAttr.Value);
|
||||
|
||||
var contentElement = xmlElement.Element($"{xmlElement.Name}.Content");
|
||||
if (contentElement == null)
|
||||
return null;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user