如何为从视图模型中移除列表视图的项目设置动画?

时间:2019-06-19 16:23:54

标签: c# animation xamarin.forms

如何为ListView的项目删除创建动画?我正在使用视图模型,它应该来自视图模型(我在这里猜)。

  <ListView ItemsSource="{Binding ObjectivosDoDia}" HorizontalOptions="FillAndExpand" HasUnevenRows="True" SeparatorColor="Transparent" x:Name="lista" Margin="0,10,0,0">
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <ViewCell>
                                    <local:ShadowFrame StartColor="{Binding CorInicio}" EndColor="{Binding CorFim}" HeightRequest="75" Padding="0" HasShadow="True">
...

                                            <Image Grid.Row="1" Grid.Column="2" Source="{Binding IconeSeleccionado}"  BackgroundColor="Transparent" HorizontalOptions="StartAndExpand" VerticalOptions="CenterAndExpand">
                                                <Image.GestureRecognizers>
                                                    <TapGestureRecognizer NumberOfTapsRequired="1" Command="{Binding BindingContext.MarcarObjectivoCompleto, Source={x:Reference homePage}}" CommandParameter="{Binding .}"/> 
                                                </Image.GestureRecognizers>
                                            </Image>

                                        </Grid>
                                    </local:ShadowFrame>
                                </ViewCell>
                            </DataTemplate>
                        </ListView.ItemTemplate>
        public ICommand MarcarObjectivoCompleto
        {
            get
            {
                return new Command<Objectivo>((obj) =>
                {
                    obj.Cumprido = true;
                    obj.CorInicio = Color.FromHex("#00778F");
                    obj.CorFim = Color.FromHex("#0B5799");
                    obj.IconeSeleccionado = ImageSource.FromFile("vistoP.png");
                    obj.CorTexto = Color.White;
                    ObjectivosDoDia.Remove(obj);
                });
            }
        }

我想使用淡入淡出动画为从ListView中删除的项目设置动画。谁能帮我吗?

0 个答案:

没有答案