add more frameworkelement properties

This commit is contained in:
bluepilledgreat 2024-10-22 19:34:17 +01:00
parent f1997a34d3
commit 6a07c9c8bd
2 changed files with 13 additions and 1 deletions

View File

@ -12,7 +12,10 @@
"HorizontalAlignment": "HorizontalAlignment",
"VerticalAlignment": "VerticalAlignment",
"ZIndex": "int",
"RenderTransform": "Transform"
"RenderTransform": "Transform",
"Opacity": "double",
"OpacityMask": "Brush",
"RenderTransformOrigin": "Point"
}
},
"Control": {

View File

@ -573,6 +573,13 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
uiElement.HorizontalAlignment = ParseXmlAttribute<HorizontalAlignment>(xmlElement, "HorizontalAlignment", HorizontalAlignment.Left);
uiElement.VerticalAlignment = ParseXmlAttribute<VerticalAlignment>(xmlElement, "VerticalAlignment", VerticalAlignment.Top);
uiElement.Opacity = ParseXmlAttribute<double>(xmlElement, "Opacity", 1);
ApplyBrush_UIElement(dialog, uiElement, "OpacityMask", FrameworkElement.OpacityMaskProperty, xmlElement);
object? renderTransformOrigin = GetPointFromXElement(xmlElement, "RenderTransformOrigin");
if (renderTransformOrigin is Point)
uiElement.RenderTransformOrigin = (Point)renderTransformOrigin;
int zIndex = ParseXmlAttributeClamped(xmlElement, "ZIndex", defaultValue: 0, min: 0, max: 1000);
Panel.SetZIndex(uiElement, zIndex);
@ -605,6 +612,8 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
xmlElement.SetAttributeValue("IsEnabled", "True");
HandleXmlElement_Control(dialog, dialog, xmlElement);
dialog.Opacity = 1;
// transfer effect to element grid
dialog.ElementGrid.RenderTransform = dialog.RenderTransform;
dialog.RenderTransform = null;