Skip to content

Commit

Permalink
3.0.12-beta - AOT compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
adospace committed Dec 23, 2024
1 parent 8aa05cb commit e32c19d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
Solution_Name: ./src/MauiReactor.Build.sln
Test_Project: ./samples/UnitTests/UnitTests.csproj
TemplatePack_Name: ./src/MauiReactor.TemplatePack/MauiReactor.TemplatePack.csproj
Version: 3.0.11-beta
Version: 3.0.12-beta

steps:
- name: Checkout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public override VisualNode Render()

//Series
new RadialBarSeries()
.ItemsSource(_todoCategoryData)
.PaletteBrushes(_todoCategoryColors ?? [])
.XBindingPath("Title")
.YBindingPath("Count")
.ItemsSource(_todoCategoryData)
.ShowDataLabels(true)
.EnableTooltip(true)
.TrackFill(Theme.IsLightTheme ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public override VisualNode Render()
new SfPullToRefresh(
RenderBody()
)
.IsRefreshing(() => State.IsRefreshing)
.IsRefreshing(State.IsRefreshing)
.OnRefreshing(Refresh),

Button()
Expand All @@ -61,9 +61,9 @@ public override VisualNode Render()
.OnClicked(AddTask)
)
)
.OnNavigatedTo(() => State.IsNavigatingTo = true)
.OnNavigatedTo(() => State.IsNavigatingTo = true)
.OnNavigatedFrom(() => State.IsNavigatingTo = false)
.OnAppearing(LoadOrRefreshData);
.OnAppearing(LoadOrRefreshData);
}

VisualNode RenderBody()
Expand Down Expand Up @@ -149,7 +149,7 @@ async Task LoadData()
{
SetState(s => s.IsBusy = true);

State.Projects = await _projectRepository.ListAsync();
var projects = await _projectRepository.ListAsync();

var chartData = new List<CategoryChartData>();
var chartColors = new List<Brush>();
Expand All @@ -159,16 +159,24 @@ async Task LoadData()
{
chartColors.Add(category.ColorBrush);

var ps = State.Projects.Where(p => p.CategoryID == category.ID).ToList();
var ps = projects.Where(p => p.CategoryID == category.ID).ToList();
int tasksCount = ps.SelectMany(p => p.Tasks).Count();

chartData.Add(new(category.Title, tasksCount));
}

State.TodoCategoryData = chartData;
State.TodoCategoryColors = chartColors;
var todoCategoryData = chartData;
var todoCategoryColors = chartColors;

State.Tasks = await _taskRepository.ListAsync();
var tasks = await _taskRepository.ListAsync();

SetState(s =>
{
s.Projects = projects;
s.TodoCategoryData = chartData;
s.TodoCategoryColors = chartColors;
s.Tasks = tasks;
});
}
finally
{
Expand All @@ -182,6 +190,8 @@ async Task Refresh()
{
SetState(s => s.IsRefreshing = true);

await Task.Delay(100);

await LoadData();
}
catch (Exception e)
Expand Down

0 comments on commit e32c19d

Please sign in to comment.