Skip to content

Commit

Permalink
Fix bindings with mismatch between Source type and x:DataType
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrozsival committed Feb 23, 2024
1 parent ec29770 commit 67aee38
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://schemas.microsoft.com/dotnet/2021/maui/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Microsoft.Maui.Controls.ControlGallery.Issues"
mc:Ignorable="d"
x:Class="Microsoft.Maui.Controls.ControlGallery.Issues.Issue11764"
x:Name="Issue11764Page"
Expand All @@ -26,13 +27,13 @@
BackgroundColor="Red">
<SwipeView.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding BindingContext.TapCommand, Source={x:Reference Issue11764Page}}"
Command="{Binding TapCommand, Source={x:Reference Issue11764Page}, x:DataType=local:Issue11764}"
CommandParameter="{Binding}" />
</SwipeView.GestureRecognizers>
<SwipeView.RightItems>
<SwipeItems>
<SwipeItemView
Command="{Binding BindingContext.DeleteCommand, Source={x:Reference Issue11764Page}}"
Command="{Binding DeleteCommand, Source={x:Reference Issue11764Page}, x:DataType=local:Issue11764}"
CommandParameter="{Binding}">
<Grid
BackgroundColor="LightSlateGray">
Expand All @@ -58,7 +59,7 @@
</Grid>
</SwipeItemView>
<SwipeItemView
Command="{Binding BindingContext.PinCommand, Source={x:Reference Issue11764Page}}"
Command="{Binding PinCommand, Source={x:Reference Issue11764Page}, x:DataType=local:Issue11764}"
CommandParameter="{Binding}">
<Grid
BackgroundColor="LightSlateGray">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://schemas.microsoft.com/dotnet/2021/maui/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Microsoft.Maui.Controls.ControlGallery.Issues"
mc:Ignorable="d"
x:Class="Microsoft.Maui.Controls.ControlGallery.Issues.Issue11831"
x:Name="Issue11831Page"
Expand Down Expand Up @@ -54,7 +55,7 @@
<SwipeView.RightItems>
<SwipeItems>
<SwipeItemView
Command="{Binding BindingContext.DeleteCommand, Source={x:Reference Issue11831Page}}"
Command="{Binding DeleteCommand, Source={x:Reference Issue11831Page}, x:DataType=local:Issue11831}"
CommandParameter="{Binding}">
<Grid
BackgroundColor="LightSlateGray">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<SwipeView.RightItems>
<SwipeItems>
<SwipeItem
Command="{Binding Source={x:Reference Issue9417Page}, Path=BindingContext.DeleteCommand}"
Command="{Binding DeleteCommand, Source={x:Reference Issue9417Page}, x:DataType=local:Issue9417}"
CommandParameter="{Binding .}"
Text="Delete"
IconImageSource="{StaticResource TrashCanImage}"
Expand All @@ -50,7 +50,7 @@
<SwipeView.LeftItems>
<SwipeItems>
<SwipeItem
Command="{Binding Source={x:Reference Issue9417Page}, Path=BindingContext.EditCommand}"
Command="{Binding EditCommand, Source={x:Reference Issue9417Page}, x:DataType=local:Issue9417}"
CommandParameter="{Binding .}"
Text="Edit"
IconImageSource="{StaticResource EditImage}"
Expand Down

0 comments on commit 67aee38

Please sign in to comment.