Skip to content

Commit

Permalink
[CastIt] If the playlist fab is pressed, go to the playlist page
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfteam committed Apr 28, 2024
1 parent 37a06f1 commit 8c5cd53
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CastIt/Views/UserControls/PlayListItemCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
Margin="0,0,5,-20"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Click="OnFabClick"
Content="{Binding NumberOfFiles}"
Foreground="White"
Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" />
Expand Down
13 changes: 12 additions & 1 deletion CastIt/Views/UserControls/PlayListItemCard.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using CastIt.ViewModels.Items;
using MvvmCross.Binding.BindingContext;
using System.Threading.Tasks;
using System.Windows.Input;

namespace CastIt.Views.UserControls
Expand All @@ -20,9 +21,19 @@ public PlayListItemCard()
}

private async void Control_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
await GoToPlayList();
}

private async void OnFabClick(object sender, System.Windows.RoutedEventArgs e)
{
await GoToPlayList();
}

private async Task GoToPlayList()
{
var window = System.Windows.Application.Current.MainWindow as MainWindow;
if (!(window?.Content is MainPage view))
if (window?.Content is not MainPage view)
return;

await view.ViewModel.GoToPlayList(Vm);
Expand Down

0 comments on commit 8c5cd53

Please sign in to comment.