Skip to content

Commit

Permalink
V1.5.0 Released.
Browse files Browse the repository at this point in the history
  • Loading branch information
XceedBoucherS committed Oct 17, 2023
1 parent 71cb7c6 commit 881d949
Show file tree
Hide file tree
Showing 143 changed files with 14,176 additions and 1,187 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Toolkit/.vs/Xceed.Maui.Toolkit/v17/.futdcache.v2
Binary file not shown.
Binary file added Toolkit/.vs/Xceed.Maui.Toolkit/v17/.suo
Binary file not shown.
23 changes: 19 additions & 4 deletions Toolkit/Src/Xceed.Maui.Toolkit.LiveExplorer/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,29 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Xceed.Maui.Toolkit.LiveExplorer"
Shell.FlyoutBehavior="Disabled">
<TabBar>
Shell.FlyoutBehavior="Disabled"
BackgroundColor="White">
<Shell.TitleView>
<Grid Margin="2">
<Label Text="{Binding Title}"
FontSize="{OnPlatform Android=20, iOS=20, Default=30}"
BindingContext="{Binding CurrentItem, Source={x:Reference NavigationBar}}" />
<Label x:Name="VersionLabel"
HorizontalOptions="End" />
</Grid>
</Shell.TitleView>

<TabBar x:Name="NavigationBar">
<ShellContent Title="Xceed Toolkit for .NET MAUI"
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />

<ShellContent Title="Chart Control"
ContentTemplate="{DataTemplate local:ChartPage}"
Route="ChartPage" />

<ShellContent Title="About Xceed"
ContentTemplate="{DataTemplate local:AboutXceedPage}"
Route="AboutXceedPage" />
</TabBar>
Route="AboutXceedPage" />
</TabBar>
</Shell>
5 changes: 5 additions & 0 deletions Toolkit/Src/Xceed.Maui.Toolkit.LiveExplorer/AppShell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ the use or inability to use the code.
*************************************************************************************/


using System.Reflection;

namespace Xceed.Maui.Toolkit.LiveExplorer
{
public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();

var version = Assembly.GetExecutingAssembly().GetName().Version;
VersionLabel.Text = "v" + version.Major + "." + version.Minor;
}
}
}
107 changes: 107 additions & 0 deletions Toolkit/Src/Xceed.Maui.Toolkit.LiveExplorer/ChartPage.xaml
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 Toolkit/Src/Xceed.Maui.Toolkit.LiveExplorer/ChartPage.xaml.cs
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();
//}
}

}
75 changes: 75 additions & 0 deletions Toolkit/Src/Xceed.Maui.Toolkit.LiveExplorer/ColorItem.cs
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 Toolkit/Src/Xceed.Maui.Toolkit.LiveExplorer/FluentColorHelper.cs
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 ) );
}
}
}
Loading

0 comments on commit 881d949

Please sign in to comment.