From e8d5dae0b39223f1656e08de31a8f3f15fea75ad Mon Sep 17 00:00:00 2001 From: Nelson Carrillo Date: Sat, 25 Jul 2015 15:52:29 -0400 Subject: [PATCH] Fixed a bug in ProgressBar --- Perspex.Controls/ProgressBar.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Perspex.Controls/ProgressBar.cs b/Perspex.Controls/ProgressBar.cs index 232039b802..2afbd3bc87 100644 --- a/Perspex.Controls/ProgressBar.cs +++ b/Perspex.Controls/ProgressBar.cs @@ -8,6 +8,7 @@ namespace Perspex.Controls { using Perspex.Controls.Primitives; using Perspex.Controls.Templates; + using System; /// /// A control used to indicate the progress of an operation. @@ -21,7 +22,7 @@ namespace Perspex.Controls var b = this.Bounds; var indicator = this.GetTemplateChild("PART_Indicator"); - indicator.Width = finalSize.Width * (this.Value / 100); + indicator.Width = Math.Max(this.Minimum, finalSize.Width * (this.Value / this.Maximum)); return size; }