Skip to content

Commit

Permalink
allow bindings to compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Miller committed Nov 14, 2024
1 parent ba420da commit 1ff976d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Maui.DataGrid.Sample/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@
<dg:DataGridColumn PropertyName="." Width="0.75*" FilteringEnabled="False">
<dg:DataGridColumn.CellTemplate>
<DataTemplate x:DataType="m:Team">
<Button Text="Edit" BackgroundColor="LightSkyBlue" Command="{Binding BindingContext.Commands[Edit], Source={Reference self}, x:DataType={x:Null}}" CommandParameter="{Binding .}" />
<Button Text="Edit" BackgroundColor="LightSkyBlue" Command="{Binding Commands[Edit], Source={RelativeSource Mode=FindAncestorBindingContext, AncestorType={x:Type vm:MainViewModel}}, x:DataType={x:Type vm:MainViewModel}}" CommandParameter="{Binding .}" />
</DataTemplate>
</dg:DataGridColumn.CellTemplate>
<dg:DataGridColumn.EditCellTemplate>
<DataTemplate x:DataType="m:Team">
<Button Text="Done" BackgroundColor="MediumSeaGreen" Command="{Binding BindingContext.Commands[CompleteEdit], Source={Reference self}, x:DataType={x:Null}}" CommandParameter="{Binding .}" />
<Button Text="Done" BackgroundColor="MediumSeaGreen" Command="{Binding Commands[CompleteEdit], Source={RelativeSource Mode=FindAncestorBindingContext, AncestorType={x:Type vm:MainViewModel}}, x:DataType={x:Type vm:MainViewModel}}" CommandParameter="{Binding .}" />
</DataTemplate>
</dg:DataGridColumn.EditCellTemplate>
</dg:DataGridColumn>
Expand Down

0 comments on commit 1ff976d

Please sign in to comment.