Skip to content

Commit

Permalink
Adding Animations To Frame Taps
Browse files Browse the repository at this point in the history
  • Loading branch information
Programming-With-Chris committed Aug 21, 2022
1 parent 1454595 commit 03d16d9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 10 deletions.
6 changes: 4 additions & 2 deletions ShoppingList/View/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
</SwipeView.RightItems>
<Frame BackgroundColor="{DynamicResource Tertiary}">
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding .}"
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:UserListViewModel}}, Path=GoToListItemsCommand}"/>
<TapGestureRecognizer CommandParameter="{Binding .}"
Tapped="FrameTapped"/>

<!--Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:UserListViewModel}}, Path=GoToListItemsCommand}"/>-->


<!--<SwipeGestureRecognizer CommandParameter="{Binding .}"
Expand Down
14 changes: 13 additions & 1 deletion ShoppingList/View/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,26 @@ public MainPage(UserListViewModel ulViewModel)

}

public async void NewListButtonPressed(object sender, EventArgs e)
private async void NewListButtonPressed(object sender, EventArgs e)
{

var circularButton = sender as CircularButton;
await circularButton.BounceOnPressAsync();

_ulvm.CreateUserList();

}
private async void FrameTapped(object sender, EventArgs e)
{

var frame = sender as Frame;
await frame.ScaleTo(1.1, 75, Easing.BounceIn);
await frame.ScaleTo(1.0, 75, Easing.BounceOut);

var userList = ((TappedEventArgs)e).Parameter as UserList;

_ulvm.GoToListItems(userList);

}
}

2 changes: 1 addition & 1 deletion ShoppingList/View/StoreFinder.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public StoreFinder(StoreFinderViewModel storeFinderViewModel)
}


public void OnSearchButtonPressed(object sender, EventArgs e)
private void OnSearchButtonPressed(object sender, EventArgs e)
{
var zipCode = ((SearchBar)sender).Text;
_sfvm.DoSearchQuery(zipCode);
Expand Down
7 changes: 2 additions & 5 deletions ShoppingList/View/UserListDetails.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,8 @@
BindingContext="{Binding .}">
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding .}"
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:UserListDetailViewModel}}, Path=GoToItemDetailCommand}"/>

<!--<SwipeGestureRecognizer CommandParameter="{Binding .}"
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:UserListDetailViewModel}}, Path=DeleteItemCommand}"
Direction="Right"/>-->
Tapped="FrameTapped"/>
<!--Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:UserListDetailViewModel}}, Path=GoToItemDetailCommand}"/>-->
</Frame.GestureRecognizers>
<Grid ColumnDefinitions="Auto,*,*"
RowDefinitions="*,Auto"
Expand Down
12 changes: 11 additions & 1 deletion ShoppingList/View/UserListDetails.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public UserListDetails(UserListDetailViewModel userListDetailViewModel)

}

public void OnCheckboxClicked(object sender, CheckedChangedEventArgs e)
private void OnCheckboxClicked(object sender, CheckedChangedEventArgs e)
{

CheckBox thisCheckbox = sender as CheckBox;
Expand Down Expand Up @@ -57,4 +57,14 @@ private async void UndoButtonPressed(object sender, EventArgs e)
await circularButton.BounceOnPressAsync();
_ulvm.UndoButtonPressed();
}
private async void FrameTapped(object sender, EventArgs e)
{

var frame = sender as Frame;
await frame.ScaleTo(1.1, 100, Easing.BounceIn);
await frame.ScaleTo(1.0, 75, Easing.BounceOut);

var item = ((TappedEventArgs)e).Parameter as Item;
_ulvm.GoToItemDetail(item);
}
}

0 comments on commit 03d16d9

Please sign in to comment.