Skip to content

Commit

Permalink
chore: Improving comments to explain code
Browse files Browse the repository at this point in the history
  • Loading branch information
eriklimakc committed May 14, 2024
1 parent 56e5bb7 commit efdbeeb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions UI/BindingSources/CSHARP/Binding/MainPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<MainViewModel>()
.Binding(vm => vm.RemoveItemCommand)
);
Expand All @@ -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<MainViewModel>()
.Binding(vm => vm.RemoveItemCommand)
)
Expand Down

0 comments on commit efdbeeb

Please sign in to comment.