add cornerradius to progress bar

This commit is contained in:
bluepilledgreat 2024-10-24 21:27:15 +01:00
parent 4d9c647edb
commit 611f2f1c91
3 changed files with 15 additions and 2 deletions

View File

@ -61,6 +61,11 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
private static object? GetPointFromXElement(XElement xmlElement, string attributeName) => GetTypeFromXElement(PointConverter, xmlElement, attributeName);
private static CornerRadiusConverter? _cornerRadiusConverter = null;
public static CornerRadiusConverter CornerRadiusConverter { get => _cornerRadiusConverter ??= new CornerRadiusConverter(); }
private static object? GetCornerRadiusFromXElement(XElement xmlElement, string attributeName) => GetTypeFromXElement(CornerRadiusConverter, xmlElement, attributeName);
private static BrushConverter? _brushConverter = null;
private static BrushConverter BrushConverter { get => _brushConverter ??= new BrushConverter(); }

View File

@ -738,7 +738,7 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
private static UIElement HandleXmlElement_ProgressBar(CustomDialog dialog, XElement xmlElement)
{
var progressBar = new ProgressBar();
var progressBar = new Wpf.Ui.Controls.ProgressBar();
HandleXmlElement_Control(dialog, progressBar, xmlElement);
progressBar.IsIndeterminate = ParseXmlAttribute<bool>(xmlElement, "IsIndeterminate", false);
@ -746,6 +746,14 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
progressBar.Value = ParseXmlAttribute<double>(xmlElement, "Value", 0);
progressBar.Maximum = ParseXmlAttribute<double>(xmlElement, "Maximum", 100);
object? cornerRadius = GetCornerRadiusFromXElement(xmlElement, "CornerRadius");
if (cornerRadius != null)
progressBar.CornerRadius = (CornerRadius)cornerRadius;
object? indicatorCornerRadius = GetCornerRadiusFromXElement(xmlElement, "IndicatorCornerRadius");
if (indicatorCornerRadius != null)
progressBar.IndicatorCornerRadius = (CornerRadius)indicatorCornerRadius;
if (xmlElement.Attribute("Name")?.Value == "PrimaryProgressBar")
{
Binding isIndeterminateBinding = new Binding("ProgressIndeterminate") { Mode = BindingMode.OneWay };

2
wpfui

@ -1 +1 @@
Subproject commit cdc5d6455ea313a19a048ae1d746b3825465f341
Subproject commit 05dad87af09d6bbf39f657a444128b1e814993a5