Skip to content

Commit

Permalink
-Added support for tapping on Direct images to view them in full-scre…
Browse files Browse the repository at this point in the history
…en mode. #12
  • Loading branch information
NGame1 committed Aug 23, 2022
1 parent f13d698 commit 0cdd06d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
Background="#80B00000">

<Image Source="{x:Bind DirectItem.Media.Images[0].Uri, Mode=OneWay}"
MaxWidth="185" x:Name="imgMedia"/>
Tapped="imgMedia_Tapped"
MaxWidth="185" x:Name="imgMedia"/>

<MediaElement PosterSource="{x:Bind DirectItem.Media.Images[0].Uri, Mode=OneWay}"
AreTransportControlsEnabled="True"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
using System;
using Windows.Media.Core;
using Windows.UI.Xaml;
using WinstaCore.Interfaces.Views.Medias;
using WinstaCore;
using Microsoft.Extensions.DependencyInjection;
using WinstaCore.Services;

// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236

Expand Down Expand Up @@ -29,5 +33,12 @@ protected override void OnDirectItemChanged()
new Uri(DirectItem.Media.Videos[0].Uri, UriKind.RelativeOrAbsolute)));
}
}

private void imgMedia_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
{
var NavigationService = AppCore.Container.GetService<NavigationService>();
var ImageViewerPage = AppCore.Container.GetService<IImageViewerPage>();
NavigationService.Navigate(ImageViewerPage, DirectItem.Media.Images[0].Uri);
}
}
}

0 comments on commit 0cdd06d

Please sign in to comment.