private void FillTable(DatabaseClasses.Customer customer)
        {
            try
            {
                foreach (var property in customer.GetType().GetProperties())
                {
                    TextCell tc = new TextCell()
                    {
                        TextColor = Color.WhiteSmoke, DetailColor = Color.Peru,
                    };
                    var id  = property.Name;
                    var val = property.GetValue(customer);

                    tc.Text   = id;
                    tc.Detail = val.ToString();
                    Section.Add(tc);
                }
                HeaderLabel.Text = "Customer ID: " + customer.Code;
                Content          = StackLayout;
            }
            catch (Exception ex)
            {
                HeaderLabel.Text = ex.ToString();
            }
        }
示例#2
0
 private void ListView_OnItemTapped(object sender, ItemTappedEventArgs e)
 {
     try
     {
         string[] esplit = e.Item.ToString().Split(':');
         DatabaseClasses.Customer item = _otherlist.FirstOrDefault(i => i.Code.ToString() == esplit[0]);
         if (item == null)
         {
             EditorWarning.Text = "Customer could not be found.";
             return;
         }
         Navigation.PushModalAsync(new DisplayItemPage(item));
     }
     catch (Exception ex)
     {
         EditorWarning.Text = ex.ToString();
     }
 }
        public DisplayItemPage(DatabaseClasses.Customer customer)
        {
            InitializeComponent();

            FillTable(customer);
        }