Browse Source

Stylecop-ed ProgressBar stuff.

pull/63/head
Steven Kirk 11 years ago
parent
commit
570d37509a
  1. 36
      Perspex.Controls/Primitives/RangeBase.cs
  2. 23
      Perspex.Controls/ProgressBar.cs
  3. 8
      Perspex.Themes.Default/ProgressBarStyle.cs

36
Perspex.Controls/Primitives/RangeBase.cs

@ -1,33 +1,55 @@
namespace Perspex.Controls.Primitives
{
using System;
using System.Reactive;
using System.Reactive.Linq;
using Perspex.Controls.Templates;
// -----------------------------------------------------------------------
// <copyright file="RangeBase.cs" company="Steven Kirk">
// Copyright 2015 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Controls.Primitives
{
/// <summary>
/// Base class for controls that display a value within a range.
/// </summary>
public abstract class RangeBase : TemplatedControl
{
/// <summary>
/// Defines the <see cref="Minimum"/> property.
/// </summary>
public static readonly PerspexProperty<double> MinimumProperty =
PerspexProperty.Register<RangeBase, double>("Minimum");
PerspexProperty.Register<RangeBase, double>("Minimum");
/// <summary>
/// Defines the <see cref="Maximum"/> property.
/// </summary>
public static readonly PerspexProperty<double> MaximumProperty =
PerspexProperty.Register<RangeBase, double>("Maximum", defaultValue: 100.0);
/// <summary>
/// Defines the <see cref="Value"/> property.
/// </summary>
public static readonly PerspexProperty<double> ValueProperty =
PerspexProperty.Register<RangeBase, double>("Value");
/// <summary>
/// Gets or sets the minimum value.
/// </summary>
public double Minimum
{
get { return this.GetValue(MinimumProperty); }
set { this.SetValue(MinimumProperty, value); }
}
/// <summary>
/// Gets or sets the maximum value.
/// </summary>
public double Maximum
{
get { return this.GetValue(MaximumProperty); }
set { this.SetValue(MaximumProperty, value); }
}
/// <summary>
/// Gets or sets the current value.
/// </summary>
public double Value
{
get { return this.GetValue(ValueProperty); }

23
Perspex.Controls/ProgressBar.cs

@ -1,19 +1,20 @@
namespace Perspex.Controls
// -----------------------------------------------------------------------
// <copyright file="ProgressBar.cs" company="Steven Kirk">
// Copyright 2015 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Controls
{
using System;
using System.Reactive;
using System.Reactive.Linq;
using Perspex.Controls.Templates;
using Perspex.Controls.Primitives;
using Perspex.Controls.Templates;
/// <summary>
/// A control used to indicate the progress of an operation.
/// </summary>
public class ProgressBar : RangeBase
{
public static readonly PerspexProperty<bool> IsIndeterminateProperty =
PerspexProperty.Register<ProgressBar, bool>("IsIndeterminate", defaultValue: false);
public static readonly PerspexProperty<Orientation> OrientationProperty =
PerspexProperty.Register<ProgressBar, Orientation>("Orientation", defaultValue: Orientation.Horizontal);
/// <inheritdoc/>
protected override Size ArrangeOverride(Size finalSize)
{
var size = base.ArrangeOverride(finalSize);

8
Perspex.Themes.Default/ProgressBarStyle.cs

@ -1,4 +1,10 @@
namespace Perspex.Themes.Default
// -----------------------------------------------------------------------
// <copyright file="ProgressBarStyle.cs" company="Steven Kirk">
// Copyright 2015 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Themes.Default
{
using System.Linq;
using System.Reactive.Linq;

Loading…
Cancel
Save