Esempio n. 1
0
      public AccountsMapView(AccountsViewModel vm)
      {
        this.Title = "Map";
        this.Icon = "map.png";

        this.BindingContext = vm;


        ViewModel.PropertyChanged += (sender, args) =>
          {
            if (args.PropertyName == "Accounts")
              MakeMap();
          };
       

        map = new Map()
        {
          IsShowingUser = true
        };

        MakeMap();
        var stack = new StackLayout { Spacing = 0 };

        map.VerticalOptions = LayoutOptions.FillAndExpand;
        map.HeightRequest = 100;
        map.WidthRequest = 960;

        stack.Children.Add(map);
        Content = stack;
      }
Esempio n. 2
0
		public AccountsView(AccountsViewModel viewModel)
		{
			InitializeComponent ();

			this.BindingContext = this.viewModel = viewModel;


		}
Esempio n. 3
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());
        }