-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71cb7c6
commit 881d949
Showing
143 changed files
with
14,176 additions
and
1,187 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+564 KB
Toolkit/.vs/Xceed.Maui.Toolkit/FileContentIndex/c35a661c-e22a-4d83-9159-fb85f287a580.vsidx
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
Toolkit/Src/Xceed.Maui.Toolkit.LiveExplorer/ChartPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- | ||
/*************************************************************************************** | ||
Xceed Toolkit for MAUI is a multiplatform toolkit offered by Xceed Software Inc., | ||
makers of the popular WPF Toolkit. | ||
COPYRIGHT (C) 2023 Xceed Software Inc. ALL RIGHTS RESERVED. | ||
This program is provided to you under the terms of a Xceed Community License | ||
For more details about the Xceed Community License please visit the products GitHub or NuGet page . | ||
DISCLAIMER: This code is provided as-is and without warranty of any kind, express or implied. The | ||
author(s) and owner(s) of this code shall not be liable for any damages or losses resulting from | ||
the use or inability to use the code. | ||
*************************************************************************************/ | ||
--> | ||
|
||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Xceed.Maui.Toolkit.LiveExplorer.ChartPage" | ||
xmlns:xctk="http://schemas.xceed.com/maui/xaml/toolkit" | ||
Title="ChartPage"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
|
||
<StackLayout Orientation="Horizontal"> | ||
<xctk:Button x:Name="AddPointButton" | ||
Content="Add Data Point" | ||
Clicked="AddPointButton_Clicked" | ||
Margin="8" /> | ||
|
||
<xctk:Button x:Name="ChangeChartButton" | ||
Content="Add Bar Chart" | ||
Clicked="ChangeChartButton_Clicked" | ||
Margin="8"/> | ||
</StackLayout> | ||
|
||
<xctk:Chart x:Name="MyChart" | ||
Grid.Row="1"> | ||
<xctk:Chart.HorizontalAxis> | ||
<xctk:Axis TickLabelType="Text" /> | ||
</xctk:Chart.HorizontalAxis> | ||
<xctk:Chart.Series> | ||
<xctk:Series x:Name="FirstSeries"> | ||
<xctk:Series.DataPoints> | ||
<xctk:DataPoint Text="0" | ||
Y="44" /> | ||
<xctk:DataPoint Text="1" | ||
Y="64" /> | ||
<xctk:DataPoint Text="2" | ||
Y="60" /> | ||
<xctk:DataPoint Text="3" | ||
Y="32" /> | ||
<xctk:DataPoint Text="4" | ||
Y="52" /> | ||
<xctk:DataPoint Text="5" | ||
Y="72" /> | ||
<xctk:DataPoint Text="6" | ||
Y="32" /> | ||
</xctk:Series.DataPoints> | ||
</xctk:Series> | ||
<xctk:Series> | ||
<xctk:Series.DataPoints> | ||
<xctk:DataPoint Text="0" | ||
Y="56" /> | ||
<xctk:DataPoint Text="1" | ||
Y="32" /> | ||
<xctk:DataPoint Text="2" | ||
Y="42" /> | ||
<xctk:DataPoint Text="3" | ||
Y="58" /> | ||
<xctk:DataPoint Text="4" | ||
Y="41" /> | ||
<xctk:DataPoint Text="5" | ||
Y="68" /> | ||
<xctk:DataPoint Text="6" | ||
Y="39" /> | ||
</xctk:Series.DataPoints> | ||
</xctk:Series> | ||
<xctk:Series> | ||
<xctk:Series.DataPoints> | ||
<xctk:DataPoint Text="0" | ||
Y="36" /> | ||
<xctk:DataPoint Text="1" | ||
Y="42" /> | ||
<xctk:DataPoint Text="2" | ||
Y="52" /> | ||
<xctk:DataPoint Text="3" | ||
Y="28" /> | ||
<xctk:DataPoint Text="4" | ||
Y="31" /> | ||
<xctk:DataPoint Text="5" | ||
Y="78" /> | ||
<xctk:DataPoint Text="6" | ||
Y="29" /> | ||
</xctk:Series.DataPoints> | ||
</xctk:Series> | ||
</xctk:Chart.Series> | ||
</xctk:Chart> | ||
</Grid> | ||
</ContentPage> |
55 changes: 55 additions & 0 deletions
55
Toolkit/Src/Xceed.Maui.Toolkit.LiveExplorer/ChartPage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/*************************************************************************************** | ||
Xceed Toolkit for MAUI is a multiplatform toolkit offered by Xceed Software Inc., | ||
makers of the popular WPF Toolkit. | ||
COPYRIGHT (C) 2023 Xceed Software Inc. ALL RIGHTS RESERVED. | ||
This program is provided to you under the terms of a Xceed Community License | ||
For more details about the Xceed Community License please visit the products GitHub or NuGet page . | ||
DISCLAIMER: This code is provided as-is and without warranty of any kind, express or implied. The | ||
author(s) and owner(s) of this code shall not be liable for any damages or losses resulting from | ||
the use or inability to use the code. | ||
*************************************************************************************/ | ||
|
||
|
||
namespace Xceed.Maui.Toolkit.LiveExplorer; | ||
|
||
public partial class ChartPage : ContentPage | ||
{ | ||
public ChartPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
Random _random = new Random(); | ||
private void AddPointButton_Clicked(object sender, EventArgs e) | ||
{ | ||
var randomSeries = _random.Next(0, MyChart.Series.Count); | ||
|
||
// Create a new DataPoint object | ||
DataPoint myDataPoint = new DataPoint() | ||
{ | ||
Y = _random.Next(30, 70), | ||
Text = MyChart.Series[randomSeries].DataPoints.Count.ToString() | ||
}; | ||
|
||
MyChart.Series[randomSeries].DataPoints.Add(myDataPoint); | ||
|
||
System.Diagnostics.Debug.WriteLine($"my series has {FirstSeries.DataPoints.Count.ToString()} points"); | ||
} | ||
|
||
private void ChangeChartButton_Clicked(object sender, EventArgs e) | ||
{ | ||
FirstSeries.Renderer = new BarRenderer(); | ||
|
||
//foreach (Series series in MyChart.Series) | ||
//{ | ||
// series.Renderer = new BarRenderer(); | ||
//} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/*************************************************************************************** | ||
Xceed Toolkit for MAUI is a multiplatform toolkit offered by Xceed Software Inc., | ||
makers of the popular WPF Toolkit. | ||
COPYRIGHT (C) 2023 Xceed Software Inc. ALL RIGHTS RESERVED. | ||
This program is provided to you under the terms of a Xceed Community License | ||
For more details about the Xceed Community License please visit the products GitHub or NuGet page . | ||
DISCLAIMER: This code is provided as-is and without warranty of any kind, express or implied. The | ||
author(s) and owner(s) of this code shall not be liable for any damages or losses resulting from | ||
the use or inability to use the code. | ||
*************************************************************************************/ | ||
|
||
|
||
using System.Windows.Input; | ||
|
||
namespace Xceed.Maui.Toolkit.LiveExplorer | ||
{ | ||
public class ColorItem | ||
{ | ||
public Color Color | ||
{ | ||
get; | ||
set; | ||
} | ||
public string Name | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
public ICommand SelectedColorCommand | ||
{ | ||
get; | ||
private set; | ||
} | ||
|
||
public ColorItem( Color color, string name ) | ||
{ | ||
this.Color = color; | ||
this.Name = name; | ||
this.SelectedColorCommand = new Command( | ||
execute: ( arg ) => | ||
{ | ||
if( Enum.TryParse( arg.ToString(), out FluentDesignAccentColor color ) ) | ||
{ | ||
ICollection<ResourceDictionary> mergedDictionaries = Application.Current.Resources.MergedDictionaries; | ||
if( mergedDictionaries != null ) | ||
{ | ||
mergedDictionaries.Clear(); | ||
mergedDictionaries.Add( new FluentDesign() { AccentColor = color } ); | ||
} | ||
} | ||
} ); | ||
} | ||
|
||
public override bool Equals( object obj ) | ||
{ | ||
var ci = obj as ColorItem; | ||
if( ci == null ) | ||
return false; | ||
return ( ci.Color.Equals( Color ) && ci.Name.Equals( Name ) ); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return this.Color.GetHashCode() ^ this.Name.GetHashCode(); | ||
} | ||
} | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
Toolkit/Src/Xceed.Maui.Toolkit.LiveExplorer/FluentColorHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/*************************************************************************************** | ||
Xceed Toolkit for MAUI is a multiplatform toolkit offered by Xceed Software Inc., | ||
makers of the popular WPF Toolkit. | ||
COPYRIGHT (C) 2023 Xceed Software Inc. ALL RIGHTS RESERVED. | ||
This program is provided to you under the terms of a Xceed Community License | ||
For more details about the Xceed Community License please visit the products GitHub or NuGet page . | ||
DISCLAIMER: This code is provided as-is and without warranty of any kind, express or implied. The | ||
author(s) and owner(s) of this code shall not be liable for any damages or losses resulting from | ||
the use or inability to use the code. | ||
*************************************************************************************/ | ||
|
||
|
||
using System.Collections.ObjectModel; | ||
using System.Reflection; | ||
using Xceed.Maui.Toolkit.Themes; | ||
|
||
namespace Xceed.Maui.Toolkit.LiveExplorer | ||
{ | ||
public sealed class FluentColorHelper | ||
{ | ||
public static ObservableCollection<ColorItem> AvailableFluentColors { get; } = FluentColorHelper.CreateAvailableColors(); | ||
|
||
private static ObservableCollection<ColorItem> CreateAvailableColors() | ||
{ | ||
var availableColors = new ObservableCollection<ColorItem>(); | ||
|
||
foreach( var item in FluentColorHelper.GetFluentColors() ) | ||
{ | ||
var colorItem = new ColorItem( item.Value, item.Key ); | ||
if( !availableColors.Contains( colorItem ) ) | ||
{ | ||
availableColors.Add( colorItem ); | ||
} | ||
} | ||
|
||
return availableColors; | ||
} | ||
|
||
private static Dictionary<string, Color> GetFluentColors() | ||
{ | ||
var colorProperties = typeof( FluentColors ).GetFields( BindingFlags.Public | BindingFlags.Static ); | ||
return colorProperties.ToDictionary( p => p.Name, p => ( Color )p.GetValue( null ) ); | ||
} | ||
} | ||
} |
Oops, something went wrong.