Files
aistudio-wpf-diagram/Live-Charts-master/Examples/UWP/Gauges/AngularGaugeExmple.xaml.cs
2021-07-23 09:42:22 +08:00

61 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace UWP.Gauges
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class AngularGaugeExmple : Page, INotifyPropertyChanged
{
private double _value;
public AngularGaugeExmple()
{
InitializeComponent();
Value = 160;
DataContext = this;
}
public double Value
{
get { return _value; }
set
{
_value = value;
OnPropertyChanged();
}
}
private void ChangeValueOnClick(object sender, RoutedEventArgs e)
{
Value = new Random().Next(50, 250);
}
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged([CallerMemberName]string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}