예제 #1
0
        public AccountMapView(AccountDetailsViewModel vm)
        {
            this.Title = "Map";
            this.Icon = "map.png";

            this.BindingContext = vm;


            ViewModel.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == "Account")
                    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;
        }
예제 #2
0
    public AccountDetailsView(AccountDetailsViewModel vmAcct, OrdersViewModel vmOrders)
    {
      InitializeComponent();
      vmOrders.Account = vmAcct.Account;
      this.BindingContext = viewModelOrders = vmOrders;

      this.Icon = "account.png";
      this.Title = "Account";

    }
예제 #3
0
        public AccountNotesView(AccountDetailsViewModel vm)
        {

            SetBinding(Page.TitleProperty, new Binding("Title"));
            SetBinding(Page.IconProperty, new Binding("Icon"));

            this.BindingContext = viewModel = vm;

            this.Content = this.BuildView();

        } //end ctor
예제 #4
0
        public LeadDetailsTabView(Account l)
        {
            if (l != null)
            {
                this.Title = l.Company;
            }
            else
            {
                this.Title = "New Lead";
            }
            


            Account lead = l == null ? new Account() { IsLead = true } : l;

            
            viewModel = new AccountDetailsViewModel(lead) { Navigation = Navigation };

            //this.Children.Add(new LeadDetailsView(viewModel)
            this.Children.Add(new LeadDetailsView(viewModel)
                {
                    Title = "Company"
                });
            this.Children.Add(new AccountContactView(viewModel) 
            {
                Title = "Contact"
            });

            this.Children.Add(new AccountMapView(viewModel)
            {

                Title = "Map"
            });


            ToolbarItems.Add(new ToolbarItem("Done", "save.png", async () =>
            {
                var confirmed = await DisplayAlert("Unsaved Changes", "Save changes?", "Save", "Discard");
                if (confirmed)
                {
                    viewModel.SaveAccountCommand.Execute(null);

                }
                else
                {
                    viewModel.GoBack();
                    System.Diagnostics.Debug.WriteLine("cancel changes!");
                }
            }));
            

        } //end ctor
		public AccountContactView (AccountDetailsViewModel vm)
		{

				InitializeComponent();

				SetBinding(Page.TitleProperty, new Binding("Title"));
        //SetBinding(Page.IconProperty, new Binding("Icon"));

        this.Icon = "contact.png";

				this.BindingContext = vm;



		} //end ctor
예제 #6
0
      public AccountDetailsTabView(Account account)
      {

          try
          {


              if (account != null)
              {
                  this.Title = account.Company;
              }
              else
              {
                  this.Title = "New Lead";
              }


              //ToolbarItems.Add(new ToolbarItem
              //{
              //    Icon = "refresh.png",
              //    Name = "refresh"
              //    //Command = viewModelOrder.LoadOrdersCommand
              //});

              viewModelAcct = new AccountDetailsViewModel(account) { Navigation = Navigation };
              viewModelOrder = new OrdersViewModel(true, account.Id) { Navigation = Navigation };
              viewModelHistory = new OrdersViewModel(false, account.Id) { Navigation = Navigation };

              viewAcctDetails = new AccountDetailsView(viewModelAcct, viewModelHistory);
              this.Children.Add(viewAcctDetails);


              viewAcctOrders = new AccountOrdersView(account.Id, viewModelOrder) { Title = "Orders" };
              this.Children.Add(viewAcctOrders);

              viewAcctHistory = new AccountHistoryView(viewModelHistory) { Title = "History" };
              this.Children.Add(viewAcctHistory);

              viewAcctMap = new AccountMapView(viewModelAcct);
              this.Children.Add(viewAcctMap);

          }
          catch (Exception exc)
          {
              System.Diagnostics.Debug.WriteLine("EXCEPTION: AccountDetailsTabView.Constructor(): " + exc.Message + "  |  " + exc.StackTrace);
          }

      }  //end ctor