Skip to content

Commit 354e070

Browse files
committed
Simplification
1 parent 557315b commit 354e070

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TodoApp/src/TodoApp.Shared/MainPage.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private async void RecoverState(object sender, RoutedEventArgs e)
3535
var viewmodel = JsonConvert.DeserializeObject<MainPageViewModel>(text);
3636
if (viewmodel?.TodoItems.Any() == true)
3737
{
38-
((MainPageViewModel)DataContext).TodoItems.AddRange(viewmodel.TodoItems);
38+
DataContext = viewmodel;
3939
}
4040
}
4141
}

0 commit comments

Comments
 (0)