Skip to content

Instantly share code, notes, and snippets.

@BryanOroxon
Created December 30, 2019 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BryanOroxon/dd184a2e2681fb301420ed443fda2cf8 to your computer and use it in GitHub Desktop.
Save BryanOroxon/dd184a2e2681fb301420ed443fda2cf8 to your computer and use it in GitHub Desktop.
CollectionMovies.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using GifInMotion.ViewModels;
namespace GifInMotion.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class CollectionMovies : ContentPage
{
public MovieViewModel viewModel;
public CollectionMovies()
{
InitializeComponent();
BindingContext = viewModel = new MovieViewModel();
if (viewModel.Movies.Count == 0)
{
viewModel.GetMoviesCommand.Execute("Collection View");
CollectionViewSource.ItemsSource = viewModel.Movies;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment