Example #1
0
        public AppData()
        {
            InfoCollection = new ObservableCollection <TestVM>();
            TestVM building1 = new TestVM();
            TestVM building2 = new TestVM();
            TestVM building3 = new TestVM();
            TestVM building4 = new TestVM();

            building1.Title     = "Building1";
            building1.TimeTaken = DateTime.Now;
            building1.Detail    = "Building4--beatiful";
            building1.Image     = "https://developer.xamarin.com/demo/IMG_1415.JPG?width=250";

            building2.Title     = "Building2";
            building2.TimeTaken = DateTime.Now;
            building2.Detail    = "Building4--beatiful";
            building2.Image     = "https://developer.xamarin.com/demo/IMG_0074.JPG";

            building3.Title     = "Building3";
            building3.TimeTaken = DateTime.Now;
            building3.Detail    = "Building3--beatiful";
            building3.Image     = "https://developer.xamarin.com/demo/IMG_3256.JPG";

            building4.Title     = "Building4";
            building4.TimeTaken = DateTime.Now;
            building4.Detail    = "Building4--beatiful";
            building4.Image     = "https://developer.xamarin.com/demo/IMG_0925.JPG?width=512";

            InfoCollection.Add(building1);
            InfoCollection.Add(building2);
            InfoCollection.Add(building3);
            InfoCollection.Add(building4);
        }
Example #2
0
		public ImageDetailPage(TestVM info)
		{
			BindingContext = info;
			InitializeComponent();
				

		}
Example #3
0
 public void DownCommand(TestVM curr)
 {
     if (InfoCollection.IndexOf(curr) < InfoCollection.Count)
     {
         InfoCollection.Move(InfoCollection.IndexOf(curr), InfoCollection.IndexOf(curr) + 1);
     }
 }
Example #4
0
        //public static TestVM building1 { set; get; }


        public void UpCommand(TestVM curr)
        {
            if (InfoCollection.IndexOf(curr) >= 1)
            {
                InfoCollection.Move(InfoCollection.IndexOf(curr), InfoCollection.IndexOf(curr) - 1);
            }
        }
Example #5
0
        //async void GoToInfoPage(TestVM info)
        async void GoToInfoPage(TestVM info, bool isNewItem)
        {
            // Get AppData object (set to BindingContext in XAML file).
            AppData appData = (AppData)BindingContext;

            // Set info item to CurrentInfo property of AppData.
            appData.CurrentInfo = info;
            // Navigate to the info page.
            await Navigation.PushModalAsync(new ImageDetailPage(info));

            // Add new info item to the collection.
            if (isNewItem)
            {
                appData.InfoCollection.Add(info);
            }
        }
Example #6
0
 public void AddCommand(TestVM curr)
 {
 }
Example #7
0
 public void DeleteCommand(TestVM curr)
 {
     InfoCollection.Remove(curr);
 }