Skip to content
Permalink
55ffe53e1c
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
41 lines (37 sloc) 1.11 KB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using HarPadRee.Models;
namespace HarPadRee
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MillagePage : ContentPage
{
int ID;
public MillagePage(int CarID, string CarName)
{
InitializeComponent();
Title = CarName + " Services";
ID = CarID;
List<MilleageModel> millage = App.MillageRepo.GetAllMillage(ID);
MillageList.ItemsSource = millage;
MessagingCenter.Subscribe<App>((App)Application.Current, "UpdateMillage", (sender) =>
{
UpdateListview();
});
}
private void AddBtn_Clicked(object sender, EventArgs e)
{
Navigation.PushAsync(new AddPage(2, ID));
}
private void UpdateListview()
{
List<MilleageModel> millage = App.MillageRepo.GetAllMillage(ID);
MillageList.ItemsSource = millage;
}
}
}