Skip to content

Commit e32c19d

Browse files
committed
3.0.12-beta - AOT compliance
1 parent 8aa05cb commit e32c19d

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

.github/workflows/build-deploy-beta.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
Solution_Name: ./src/MauiReactor.Build.sln
1717
Test_Project: ./samples/UnitTests/UnitTests.csproj
1818
TemplatePack_Name: ./src/MauiReactor.TemplatePack/MauiReactor.TemplatePack.csproj
19-
Version: 3.0.11-beta
19+
Version: 3.0.12-beta
2020

2121
steps:
2222
- name: Checkout

templates/MauiReactorTemplate.StartupSampleXaml/Components/Main/CategoryChart.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ public override VisualNode Render()
3737

3838
//Series
3939
new RadialBarSeries()
40-
.ItemsSource(_todoCategoryData)
4140
.PaletteBrushes(_todoCategoryColors ?? [])
4241
.XBindingPath("Title")
4342
.YBindingPath("Count")
43+
.ItemsSource(_todoCategoryData)
4444
.ShowDataLabels(true)
4545
.EnableTooltip(true)
4646
.TrackFill(Theme.IsLightTheme ?

templates/MauiReactorTemplate.StartupSampleXaml/Components/Main/MainPage.cs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public override VisualNode Render()
5252
new SfPullToRefresh(
5353
RenderBody()
5454
)
55-
.IsRefreshing(() => State.IsRefreshing)
55+
.IsRefreshing(State.IsRefreshing)
5656
.OnRefreshing(Refresh),
5757

5858
Button()
@@ -61,9 +61,9 @@ public override VisualNode Render()
6161
.OnClicked(AddTask)
6262
)
6363
)
64-
.OnNavigatedTo(() => State.IsNavigatingTo = true)
64+
.OnNavigatedTo(() => State.IsNavigatingTo = true)
6565
.OnNavigatedFrom(() => State.IsNavigatingTo = false)
66-
.OnAppearing(LoadOrRefreshData);
66+
.OnAppearing(LoadOrRefreshData);
6767
}
6868

6969
VisualNode RenderBody()
@@ -149,7 +149,7 @@ async Task LoadData()
149149
{
150150
SetState(s => s.IsBusy = true);
151151

152-
State.Projects = await _projectRepository.ListAsync();
152+
var projects = await _projectRepository.ListAsync();
153153

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

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

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

168-
State.TodoCategoryData = chartData;
169-
State.TodoCategoryColors = chartColors;
168+
var todoCategoryData = chartData;
169+
var todoCategoryColors = chartColors;
170170

171-
State.Tasks = await _taskRepository.ListAsync();
171+
var tasks = await _taskRepository.ListAsync();
172+
173+
SetState(s =>
174+
{
175+
s.Projects = projects;
176+
s.TodoCategoryData = chartData;
177+
s.TodoCategoryColors = chartColors;
178+
s.Tasks = tasks;
179+
});
172180
}
173181
finally
174182
{
@@ -182,6 +190,8 @@ async Task Refresh()
182190
{
183191
SetState(s => s.IsRefreshing = true);
184192

193+
await Task.Delay(100);
194+
185195
await LoadData();
186196
}
187197
catch (Exception e)

0 commit comments

Comments
 (0)