项目结构调整

This commit is contained in:
艾竹
2023-04-16 20:11:40 +08:00
parent cbfbf96033
commit 81f91f3f35
2124 changed files with 218 additions and 5516 deletions

View File

@@ -0,0 +1,28 @@
<Page
x:Class="UWP.Gauges.AngularGaugeExmple"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UWP.Gauges"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:lvc="using:LiveCharts.Uwp"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Button Margin="10" Click="ChangeValueOnClick">Update</Button>
<lvc:AngularGauge Grid.Row="1" Value="{Binding Value}" FromValue="50" ToValue="250"
LabelsStep="50" TicksStep="25" Wedge="300"
TicksForeground="White" Foreground="White"
FontWeight="Bold" FontSize="16"
SectionsInnerRadius=".5">
<lvc:AngularGauge.Sections>
<lvc:AngularSection FromValue="50" ToValue="200" Fill="#F8A725"/>
<lvc:AngularSection FromValue="200" ToValue="250" Fill="#FF3939"/>
</lvc:AngularGauge.Sections>
</lvc:AngularGauge>
</Grid>
</Page>

View File

@@ -0,0 +1,60 @@
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));
}
}
}

View File

@@ -0,0 +1,72 @@
<Page
x:Class="UWP.Gauges.Gauge360"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:lvc="using:LiveCharts.Uwp"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<!--normal gauge-->
<lvc:Gauge Grid.Row="0" Grid.Column="0" Margin="5"
Uses360Mode="True"
From="0" To="100" Value="50" />
<!--this gauge is rotated 90° -->
<lvc:Gauge Grid.Row="0" Grid.Column="1" Margin="5"
Uses360Mode="True"
From="0" To="100" Value="50" >
<lvc:Gauge.GaugeRenderTransform>
<TransformGroup>
<RotateTransform Angle="90"></RotateTransform>
<ScaleTransform ScaleX="-1"></ScaleTransform>
</TransformGroup>
</lvc:Gauge.GaugeRenderTransform>
</lvc:Gauge>
<lvc:Gauge Grid.Row="1" Grid.Column="0" Margin="5"
Uses360Mode="True"
From="0" To="100" Value="20"
HighFontSize="60" Foreground="White"
InnerRadius="0" GaugeBackground="#BE54A3E9"/>
<!--the next gauge interpolates from color white, to color black according
to the current value in the gauge-->
<lvc:Gauge Grid.Row="1" Grid.Column="1" Margin="5"
Uses360Mode="True"
From="0" To="100" Value="50"
HighFontSize="60" Foreground="#424242"
FromColor="White" ToColor="Black"
InnerRadius="0" GaugeBackground="Transparent">
</lvc:Gauge>
<!--standard gauge-->
<lvc:Gauge Grid.Row="2" Grid.Column="0" Margin="5"
From="0" To="100" Value="50"/>
<!--custom fill gauge-->
<lvc:Gauge Grid.Row="2" Grid.Column="1"
From="0" To="100" Value="50"
LabelsVisibility="Collapsed">
<lvc:Gauge.GaugeActiveFill>
<LinearGradientBrush>
<GradientStop Color="Yellow" Offset="0.0" />
<GradientStop Color="Orange" Offset="0.5" />
<GradientStop Color="Red" Offset="1.0" />
</LinearGradientBrush>
</lvc:Gauge.GaugeActiveFill>
</lvc:Gauge>
</Grid>
</Page>

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
// 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 Gauge360
{
}
}