From 3eb8938abee42f1ae1ea3045c2dde9a56c08ed14 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:17:56 +0100 Subject: [PATCH] uncap height and width --- .../UI/Elements/Bootstrapper/CustomDialog.Creator.cs | 11 ++--------- Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.xaml | 2 ++ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs index 1a0ab45d..a812e446 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs +++ b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs @@ -123,13 +123,6 @@ private static void ValidateXmlElement(string elementName, string attributeName, } // You can't do numeric only generics in .NET 6. The feature is exclusive to .NET 7+. - private static double ParseXmlAttributeClamped(XElement element, string attributeName, double? defaultValue = null, double? min = null, double? max = null) - { - double value = ParseXmlAttribute(element, attributeName, defaultValue); - ValidateXmlElement(element.Name.ToString(), attributeName, value, min, max); - return value; - } - private static int ParseXmlAttributeClamped(XElement element, string attributeName, int? defaultValue = null, int? min = null, int? max = null) { int value = ParseXmlAttribute(element, attributeName, defaultValue); @@ -522,8 +515,8 @@ private static void HandleXmlElement_FrameworkElement(CustomDialog dialog, Frame if (margin != null) uiElement.Margin = (Thickness)margin; - uiElement.Height = ParseXmlAttributeClamped(xmlElement, "Height", defaultValue: double.NaN, min: 0, max: 1000); - uiElement.Width = ParseXmlAttributeClamped(xmlElement, "Width", defaultValue: double.NaN, min: 0, max: 1000); + uiElement.Height = ParseXmlAttribute(xmlElement, "Height", double.NaN); + uiElement.Width = ParseXmlAttribute(xmlElement, "Width", double.NaN); // default values of these were originally Stretch but that was no good uiElement.HorizontalAlignment = ParseXmlAttribute(xmlElement, "HorizontalAlignment", HorizontalAlignment.Left); diff --git a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.xaml b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.xaml index 628e10d4..8bb44533 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.xaml +++ b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.xaml @@ -12,6 +12,8 @@ Height="450" MinWidth="150" MinHeight="150" + MaxWidth="1000" + MaxHeight="1000" Background="{ui:ThemeResource ApplicationBackgroundBrush}" ExtendsContentIntoTitleBar="True" ResizeMode="NoResize"