From efdbeebbd7693c98cd8e2f5700814668ef6d89f5 Mon Sep 17 00:00:00 2001 From: eriklimakc Date: Tue, 14 May 2024 19:07:23 +0100 Subject: [PATCH] chore: Improving comments to explain code --- UI/BindingSources/CSHARP/Binding/MainPage.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/UI/BindingSources/CSHARP/Binding/MainPage.cs b/UI/BindingSources/CSHARP/Binding/MainPage.cs index 211b2d384..add7e683a 100644 --- a/UI/BindingSources/CSHARP/Binding/MainPage.cs +++ b/UI/BindingSources/CSHARP/Binding/MainPage.cs @@ -26,8 +26,8 @@ public MainPage() .Content("Delete") .CommandParameter(() => item) .Command(x => x - // Since we have the `page` alias provided by the DataContext method - // We can use it as the binding source + // Since we have access to the `page` and `vm` alias from the DataContext method + // We can take advantage of them and use them on our binding expression .Source(page) .DataContext() .Binding(() => vm.RemoveItemCommand) @@ -59,6 +59,8 @@ private Button CreateButton() // Since we we don't have access to the page alias here (as we have on line #30) // We need to set `this` as the source .Source(this) + + // Here we specify the DataContext type so that we can access the ViewModel alias in the Binding method .DataContext() .Binding(vm => vm.RemoveItemCommand) ); @@ -74,6 +76,8 @@ private MenuFlyout MenuFlyout() // Since we we don't have access to the page alias here (as we have on line #30) // We need to set `this` as the source .Source(this) + + // Here we specify the DataContext type so that we can access the ViewModel alias in the Binding method .DataContext() .Binding(vm => vm.RemoveItemCommand) )