Xamarin.forms Xamarin ffimageloading插件点击至全屏

Xamarin.forms Xamarin ffimageloading插件点击至全屏,xamarin.forms,ffimageloading,Xamarin.forms,Ffimageloading,下面的代码使用组件渲染高度为200px的图像。我需要点击这个图像,全屏显示或缩放它。它是否可以通过ffimageloading实现,或者我需要通过每个平台(android和ios)实现它 查看 <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsof

下面的代码使用组件渲染高度为200px的图像。我需要点击这个图像,全屏显示或缩放它。它是否可以通过ffimageloading实现,或者我需要通过每个平台(android和ios)实现它

查看

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
             prism:ViewModelLocator.AutowireViewModel="True"
             xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
             x:Class="Namespace.Views.MyClass">

<Grid Padding="0"
                  Margin="0"
                  BackgroundColor="{StaticResource BackgroundColor}">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="200" />
                    </Grid.RowDefinitions>

                    <ffimageloading:CachedImage 
                        Grid.Row="0"
                        Source="{Binding ThumbPath}"
                        Aspect="AspectFill">
                        <ffimageloading:CachedImage.LoadingPlaceholder>
                            <OnPlatform   
                            x:TypeArguments="ImageSource"
                            iOS="logo_header"
                            Android="logo_header" />
                        </ffimageloading:CachedImage.LoadingPlaceholder>
                        <ffimageloading:CachedImage.ErrorPlaceholder>
                            <OnPlatform   
                            x:TypeArguments="ImageSource"
                            iOS="noimage"
                            Android="noimage" />
                        </ffimageloading:CachedImage.ErrorPlaceholder>
                    </ffimageloading:CachedImage>
                </Grid>
</ContentPage>

首先要做的是向缓存的图像添加手势识别器

<ffimageloading:CachedImage.GestureRecognizers>
    <TapGestureRecognizer Command="{Binding ViewImageCommand}" />
</ffimageloading:CachedImage.GestureRecognizers>

这将使用命令绑定到视图模型中的命令

private Command _viewImageCommand;
public Command ViewImageCommand => _viewImageCommand ?? (_viewImageCommand = new Command(async () => await ViewImage()));

private async Task ViewImage()
{
    await CoreMethods.PushPageModel<FullScreenImagePageModel>(imageName, false);
}
private命令\u viewImageCommand;
公共命令ViewImageCommand=>\u ViewImageCommand??(_viewImageCommand=new命令(异步()=>wait ViewImage());
私有异步任务ViewImage()
{
等待corethods.PushPageModel(imageName,false);
}
这将推送另一个页面以全屏显示图像


我正在使用FreshMvvm将图像的名称传递给全屏图像视图模型。

要做的第一件事是向缓存的图像添加手势识别器

<ffimageloading:CachedImage.GestureRecognizers>
    <TapGestureRecognizer Command="{Binding ViewImageCommand}" />
</ffimageloading:CachedImage.GestureRecognizers>

这将使用命令绑定到视图模型中的命令

private Command _viewImageCommand;
public Command ViewImageCommand => _viewImageCommand ?? (_viewImageCommand = new Command(async () => await ViewImage()));

private async Task ViewImage()
{
    await CoreMethods.PushPageModel<FullScreenImagePageModel>(imageName, false);
}
private命令\u viewImageCommand;
公共命令ViewImageCommand=>\u ViewImageCommand??(_viewImageCommand=new命令(异步()=>wait ViewImage());
私有异步任务ViewImage()
{
等待corethods.PushPageModel(imageName,false);
}
这将推送另一个页面以全屏显示图像


我正在使用FreshMvvm将图像的名称传递给全屏图像视图模型。

好消息。很高兴我能帮上忙。@SteveChadbourne我需要为-->
wait CoreMethods.PushPageModel(imageName,false)编写单独的代码吗线路?好消息。很高兴我能帮上忙。@SteveChadbourne我需要为-->
wait CoreMethods.PushPageModel(imageName,false)编写单独的代码吗行?我是否需要为-->Wait CoreMethods.PushPageModel(imageName,false)编写单独的代码;?我是否需要为-->Wait CoreMethods.PushPageModel(imageName,false);)编写单独的代码;?