Skip to content

Commit

Permalink
update uno docs
Browse files Browse the repository at this point in the history
  • Loading branch information
beto-rodriguez committed Oct 25, 2024
1 parent ea46e06 commit 2471b6e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/overview/1.2.install.md
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ Go to the `Solution Explorer` and browse for `Program.cs` file, then edit the it
Go to the `Solution Explorer` and browse for `UnoApp.Shared/App.xaml.cs` file, then edit the it as follows.

```
{{ render this "~/../samples/UnoPlatform_v5/UnoPlatform_v5/App.cs" }}
{{ render this "~/../samples/UnoPlatform_v5_2_175/UnoPlatform_v5_2_175/App.cs" }}
```

{{~ end ~}}
Expand Down
28 changes: 28 additions & 0 deletions samples/UnoPlatform_v5_2_175/UnoPlatform_v5_2_175/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using LiveChartsCore; // mark
using LiveChartsCore.SkiaSharpView; // mark
using SkiaSharp; // mark
using Uno.Resizetizer;

namespace UnoPlatform_v5_2_175;
Expand All @@ -14,9 +17,34 @@ public App()

protected Window? MainWindow { get; private set; }
protected IHost? Host { get; private set; }
public record City(string Name, double Population);

protected async override void OnLaunched(LaunchActivatedEventArgs args)
{
LiveCharts.Configure(config =>
config
// you can override the theme
// .AddDarkTheme()

// In case you need a non-Latin based font, you must register a typeface for SkiaSharp
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('あ')) // <- Japanese
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('헬')) // <- Korean
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('Ж')) // <- Russian

//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('أ')) // <- Arabic
//.UseRightToLeftSettings() // Enables right to left tooltips

// finally register your own mappers
// you can learn more about mappers at:
// https://livecharts.dev/docs/unowinui/2.0.0-rc2/Overview.Mappers

// here we use the index as X, and the population as Y
.HasMap<City>((city, index) => new(index, city.Population))
// .HasMap<Foo>( .... )
// .HasMap<Bar>( .... )
);

var builder = this.CreateBuilder(args)
// Add navigation support for toolkit controls such as TabBar and NavigationView
.UseToolkitNavigation()
Expand Down

0 comments on commit 2471b6e

Please sign in to comment.