19 references to Clamp
Microsoft.Maui.Controls (15)
LegacyLayouts\StackLayout.cs (4)
242 double compressionPressure = (requiredCompression / layout.CompressionSpace).Clamp(0, 1); 277 compressionPressure = (requiredCompression / compressionSpace).Clamp(0, 1); 314 double compressionPressure = (requiredCompression / layout.CompressionSpace).Clamp(0, 1); 349 compressionPressure = (requiredCompression / compressionSpace).Clamp(0, 1);
ProgressBar\ProgressBar.cs (1)
17 public static readonly BindableProperty ProgressProperty = BindableProperty.Create(nameof(Progress), typeof(double), typeof(ProgressBar), 0d, coerceValue: (bo, v) => ((double)v).Clamp(0, 1));
Slider\Slider.cs (4)
15 slider.Value = slider.Value.Clamp((double)value, slider.Maximum); 23 slider.Value = slider.Value.Clamp(slider.Minimum, (double)value); 31 return ((double)value).Clamp(slider.Minimum, slider.Maximum); 80 Value = val.Clamp(min, max);
Stepper\Stepper.cs (5)
17 stepper.Value = stepper.Value.Clamp(stepper.Minimum, (double)value); 27 stepper.Value = stepper.Value.Clamp((double)value, stepper.Maximum); 36 return Math.Round(((double)value), stepper.digits).Clamp(stepper.Minimum, stepper.Maximum); 49 propertyChanged: (b, o, n) => { ((Stepper)b).digits = (int)(-Math.Log10((double)n) + 4).Clamp(1, 15); }); 73 Value = val.Clamp(min, max);
VisualElement\VisualElement.cs (1)
273 public static readonly BindableProperty OpacityProperty = BindableProperty.Create(nameof(Opacity), typeof(double), typeof(VisualElement), 1d, coerceValue: (bindable, value) => ((double)value).Clamp(0, 1));
Microsoft.Maui.Controls.Compatibility (2)
iOS\Renderers\ScrollViewRenderer.cs (2)
281 positionOnScroll.X = positionOnScroll.X.Clamp(0, ContentSize.Width); 282 positionOnScroll.Y = positionOnScroll.Y.Clamp(0, ContentSize.Height);
Microsoft.Maui.Graphics (2)
Color.cs (2)
1004 value = value.Clamp(0, maxValue) / maxValue; 1014 value = value.Clamp(0, 1);