Skip to content

Commit

Permalink
Merge pull request #1671 from beto-rodriguez/dev
Browse files Browse the repository at this point in the history
Update web site samples to master
  • Loading branch information
beto-rodriguez authored Oct 25, 2024
2 parents b7938b1 + 1f291ee commit c66427a
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 4 deletions.
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.xaml.cs" }}
```

{{~ end ~}}
Expand Down
Binary file added docs/samples/lines/custompoints/result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions docs/samples/lines/custompoints/template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{ render this "~/shared/genericSampleSimpleHeader.md" }}

## View model

```
{{ full_name | get_vm_from_docs }}
```

## MyGeometry.cs

{{~ "~/../samples/ViewModelsSamples/Lines/Custom/MyGeometry.cs" | render_file_as_code ~}}

{{~ if xaml ~}}
## XAML
{{~ end ~}}

{{~ if winforms ~}}
## Form code behind
{{~ end ~}}

{{~ if blazor~}}
## HTML
{{~ end~}}

```
{{ full_name | get_view_from_docs }}
```

{{~ if related_to != null ~}}

### Articles you might also find useful:

{{~ for r in related_to ~}}

<div>
<a href="{{ compile this r.url }}">
{{ r.name }}
</a>
</div>

{{~ end ~}}

{{~ end ~}}
Binary file added docs/samples/pies/icons/result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/samples/pies/icons/template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ render this "~/shared/genericSampleSimple.md" }}
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
6 changes: 3 additions & 3 deletions samples/ViewModelsSamples/Pies/Icons/ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public ViewModel()

svgLabel.Path = dataItem.Svg;
svgLabel.Name = dataItem.Name;
svgLabel.Width = 50;
svgLabel.Height = 50;
svgLabel.TranslateTransform = new(-25, -25);
svgLabel.Width = 30;
svgLabel.Height = 30;
svgLabel.TranslateTransform = new(-15, -15);
});
});

Expand Down

0 comments on commit c66427a

Please sign in to comment.