Esempio n. 1
0
		public DashboardView (DashboardViewModel vm)
		{
				InitializeComponent ();

				this.BindingContext = vm;

        //var items = new List<BarItem>();
        //items.Add(new BarItem { Name = "a", Value = 10 });
        //items.Add(new BarItem { Name = "b", Value = 15 });
        //items.Add(new BarItem { Name = "c", Value = 20 });
        //items.Add(new BarItem { Name = "d", Value = 5 });
        //items.Add(new BarItem { Name = "e", Value = 14 });
				//Chart.Items = items;

        //MyPie.Items = items;
		}
Esempio n. 2
0
        NavigationPage PageForOption (MenuType option)
        {

          switch (option)
          {
            case MenuType.Dashboard:
              {
                if (dashboard != null)
                  return dashboard;
                  
                var vm = new DashboardViewModel() { Navigation = Navigation };

                dashboard = new NavigationPage(new DashboardView(vm));
                return dashboard;
              }
            case MenuType.Accounts:
              {
                if (accounts != null)
                  return accounts;

                var vm = new AccountsViewModel() { Navigation = Navigation };
                accounts = new NavigationPage(new AccountsView(vm));

                return accounts; 
              }
            case MenuType.Leads:
              {
                if (leads != null)
                  return leads;
                
                leads =  new NavigationPage(new Leads.LeadsView(new ViewModels.Leads.LeadsViewModel() { Navigation = Navigation }));
                return leads;
              }
            case MenuType.Contacts:
              {
                if (contacts != null)
                  return contacts;
                var vm = new ContactsViewModel();
                contacts = new NavigationPage(new Contacts.ContactsView(vm));
                return contacts;
              } 
            case MenuType.Catalog:
              {
                  if (catalog != null)
                      return catalog;

                  catalog = new NavigationPage(new Catalog.CatalogCarouselView());
                  return catalog;
              }

              case MenuType.Settings:
              {
                  if (settings != null)
                      return settings;

                  settings = new NavigationPage(new Settings.UserSettingsView());
                  return settings;
              }

          }
            
          throw new NotImplementedException("Unknown menu option: " + option.ToString());
        }