//The MIT License(MIT)
//Copyright(c) 2016 Alberto Rodriguez & LiveCharts Contributors
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.
using System;
using System.ComponentModel;
using System.ComponentModel.Design.Serialization;
using System.Windows;
using System.Windows.Forms.Integration;
using System.Windows.Media;
namespace LiveCharts.WinForms
{
///
///
///
///
[Designer("System.Windows.Forms.Design.ControlDesigner, System.Design")]
[DesignerSerializer("System.ComponentModel.Design.Serialization.TypeCodeDomSerializer , System.Design", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design")]
public class SolidGauge : ElementHost
{
///
/// The WPF base
///
protected readonly Wpf.Gauge WpfBase = new Wpf.Gauge();
///
/// Initializes a new instance of the class.
///
public SolidGauge()
{
Child = WpfBase;
//workaround for windows 7 focus issue
//https://github.com/beto-rodriguez/Live-Charts/issues/515
HostContainer.MouseEnter += (sender, args) =>
{
Focus();
};
}
///
/// Gets the base.
///
///
/// The base.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Wpf.Gauge Base
{
get { return WpfBase; }
}
///
/// Gets or sets a value indicating whether [uses360 mode].
///
///
/// true if [uses360 mode]; otherwise, false.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool Uses360Mode
{
get { return WpfBase.Uses360Mode; }
set { WpfBase.Uses360Mode = value; }
}
///
/// Gets or sets a value indicating whether [disable animations].
///
///
/// true if [disable animations]; otherwise, false.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool DisableAnimations
{
get { return WpfBase.DisableAnimations; }
set { WpfBase.DisableAnimations = value; }
}
///
/// Gets or sets from.
///
///
/// From.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public double From
{
get { return WpfBase.From; }
set { WpfBase.From = value; }
}
///
/// Gets or sets to.
///
///
/// To.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public double To
{
get { return WpfBase.To; }
set { WpfBase.To = value; }
}
///
/// Gets or sets the value.
///
///
/// The value.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public double Value
{
get { return WpfBase.Value; }
set { WpfBase.Value = value; }
}
///
/// Gets or sets the inner radius.
///
///
/// The inner radius.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public double? InnerRadius
{
get { return WpfBase.InnerRadius; }
set { WpfBase.InnerRadius = value; }
}
///
/// Gets or sets the stroke.
///
///
/// The stroke.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Brush Stroke
{
get { return WpfBase.Stroke; }
set { WpfBase.Stroke = value; }
}
///
/// Gets or sets the stroke thickness.
///
///
/// The stroke thickness.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public double StrokeThickness
{
get { return WpfBase.StrokeThickness; }
set { WpfBase.StrokeThickness = value; }
}
///
/// Gets or sets to color.
///
///
/// To color.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color ToColor
{
get { return WpfBase.ToColor; }
set { WpfBase.ToColor = value; }
}
///
/// Gets or sets from color.
///
///
/// From color.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color FromColor
{
get { return WpfBase.FromColor; }
set { WpfBase.FromColor = value; }
}
///
/// Gets or sets the gauge background.
///
///
/// The gauge background.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Brush GaugeBackground
{
get { return WpfBase.GaugeBackground; }
set { WpfBase.GaugeBackground = value; }
}
///
/// Gets or sets the animations speed.
///
///
/// The animations speed.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public TimeSpan AnimationsSpeed
{
get { return WpfBase.AnimationsSpeed; }
set { WpfBase.AnimationsSpeed = value; }
}
///
/// Gets or sets the label formatter.
///
///
/// The label formatter.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Func LabelFormatter
{
get { return WpfBase.LabelFormatter; }
set { WpfBase.LabelFormatter = value; }
}
///
/// Gets or sets the size of the high font.
///
///
/// The size of the high font.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public double? HighFontSize
{
get { return WpfBase.HighFontSize; }
set { WpfBase.HighFontSize = value; }
}
///
/// Gets or sets the size of the font.
///
///
/// The size of the font.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public double FontSize
{
get { return WpfBase.FontSize; }
set { WpfBase.FontSize = value; }
}
///
/// Gets or sets the font family.
///
///
/// The font family.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public FontFamily FontFamily
{
get { return WpfBase.FontFamily; }
set { WpfBase.FontFamily = value; }
}
///
/// Gets or sets the font weight.
///
///
/// The font weight.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public FontWeight FontWeight
{
get { return WpfBase.FontWeight; }
set { WpfBase.FontWeight = value; }
}
///
/// Gets or sets the font style.
///
///
/// The font style.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public FontStyle FontStyle
{
get { return WpfBase.FontStyle; }
set { WpfBase.FontStyle = value; }
}
///
/// Gets or sets the font stretch.
///
///
/// The font stretch.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public FontStretch FontStretch
{
get { return WpfBase.FontStretch; }
set { WpfBase.FontStretch = value; }
}
///
/// Gets or sets the fore ground.
///
///
/// The fore ground.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Brush ForeGround
{
get { return WpfBase.Foreground; }
set { WpfBase.Foreground = value; }
}
}
}