Exemplo n.º 1
0
        public TSSplitVCIPad()
            : base()
        {
            // create our master and detail views
            masterView = new TSSettingsView ();
            detailView = new TSAccountBasicView ();
            this.HidesBottomBarWhenPushed = false;
            this.PreferredDisplayMode = UISplitViewControllerDisplayMode.AllVisible;
            // in this example, i expose an event on the master view called RowClicked, and i listen
            // for it in here, and then call a method on the detail view to update. this class thereby
            // becomes the defacto controller for the screen (both views).
            //			masterView.RowClicked += (object sender, MasterView.MasterTableView.RowClickedEventArgs e) => {
            //				detailView.Text = e.Item;
            //			};
            //
            // when the master view controller is hid (portrait mode), we add a button to
            // the detail view that when clicked will show the master view in a popover controller
            this.WillHideViewController += (object sender, UISplitViewHideEventArgs e) => {
                //detailView.AddContentsButton (e.BarButtonItem);
            };

            //this.hid
            // when the master view controller is shown (landscape mode), remove the button
            // since the controller is shown.
            this.WillShowViewController += (object sender, UISplitViewShowEventArgs e) => {
                //detailView.RemoveContentsButton ();
            };

            // this method was introduced in iOS5
            // return true to hide the master list (can still be 'dragged out') or false to force it to show
            this.ShouldHideViewController = (svc, vc, orientation) => {
                return false;//orientation == UIInterfaceOrientation.Portrait || orientation == UIInterfaceOrientation.PortraitUpsideDown;
            };

            // ALWAYS SET THIS LAST (since iOS5.1)
            // https://bugzilla.xamarin.com/show_bug.cgi?id=3803
            // http://spouliot.wordpress.com/2012/03/26/events-vs-objective-c-delegates/
            // create an array of controllers from them and then assign it to the
            // controllers property
            ViewControllers = new UIViewController[] { masterView, detailView };
        }
Exemplo n.º 2
0
        public TSSplitVCIPad() : base()
        {
            // create our master and detail views
            masterView = new TSSettingsView();
            detailView = new TSAccountBasicView();
            this.HidesBottomBarWhenPushed = false;
            this.PreferredDisplayMode     = UISplitViewControllerDisplayMode.AllVisible;
            // in this example, i expose an event on the master view called RowClicked, and i listen
            // for it in here, and then call a method on the detail view to update. this class thereby
            // becomes the defacto controller for the screen (both views).
//			masterView.RowClicked += (object sender, MasterView.MasterTableView.RowClickedEventArgs e) => {
//				detailView.Text = e.Item;
//			};
//
            // when the master view controller is hid (portrait mode), we add a button to
            // the detail view that when clicked will show the master view in a popover controller
            this.WillHideViewController += (object sender, UISplitViewHideEventArgs e) => {
                //detailView.AddContentsButton (e.BarButtonItem);
            };

            //this.hid
            // when the master view controller is shown (landscape mode), remove the button
            // since the controller is shown.
            this.WillShowViewController += (object sender, UISplitViewShowEventArgs e) => {
                //detailView.RemoveContentsButton ();
            };

            // this method was introduced in iOS5
            // return true to hide the master list (can still be 'dragged out') or false to force it to show
            this.ShouldHideViewController = (svc, vc, orientation) => {
                return(false);               //orientation == UIInterfaceOrientation.Portrait || orientation == UIInterfaceOrientation.PortraitUpsideDown;
            };

            // ALWAYS SET THIS LAST (since iOS5.1)
            // https://bugzilla.xamarin.com/show_bug.cgi?id=3803
            // http://spouliot.wordpress.com/2012/03/26/events-vs-objective-c-delegates/
            // create an array of controllers from them and then assign it to the
            // controllers property
            ViewControllers = new UIViewController[] { masterView, detailView };
        }
Exemplo n.º 3
0
        public void SetAccountBasicLayoytIPad()
        {
            if (scrollIPad != null) {
                //				ContentViewIPad.Add (scrollIPad);
                var obj= new TSAccountBasicView();
                AddPartialView(obj.GetAcocuntBasicsView ());
            }

            //			txtDealerShipName.Layer.CornerRadius = 15;
            //			txtDealerShipName.ClipsToBounds = true;
            //			txtDealerShipName.Layer.BorderWidth = 1;
            //
            //			txtAddress1IPad.Layer.CornerRadius = 15;
            //			txtAddress1IPad.ClipsToBounds = true;
            //			txtAddress1IPad.Layer.BorderWidth = 1;
            //
            //			txtAddress2IPad.Layer.CornerRadius = 15;
            //			txtAddress2IPad.ClipsToBounds = true;
            //			txtAddress2IPad.Layer.BorderWidth = 1;
            //
            //			txtCityIPad.Layer.CornerRadius = 15;
            //			txtCityIPad.ClipsToBounds = true;
            //			txtCityIPad.Layer.BorderWidth = 1;
        }
Exemplo n.º 4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            //			TSCustomNavController nv = new TSCustomNavController ();
            //			nv.setData ();

            this.NavigationItem.HidesBackButton = true;
            NavigationController.SetNavigationBarHidden (false, true);
            var SettingsTableData = new List<TSSettingsItems> ();

            var accountItem = new TSSettingsItems {
                EntryData = new TableData {
                    Title = "Account Basics"
                },
                OnClickAction = "PushAccountbasic"
            };
            SettingsTableData.Add (accountItem);
            var setupItem = new TSSettingsItems {
                EntryData = new TableData {
                    Title = "Setup Codes"
                },
                OnClickAction = "PushSetupCodes"
            };

            SettingsTableData.Add (setupItem);

            var DepartmentsItem = new TSSettingsItems {
                EntryData = new TableData {
                    Title = "Departments"
                },
                OnClickAction = "PushDepartments"
            };
            SettingsTableData.Add (DepartmentsItem);

            var advancedItem = new TSSettingsItems {
                EntryData = new TableData {
                    Title = "Advanced"
                },
                OnClickAction = "PushAdvanced"
            };
            SettingsTableData.Add (advancedItem);

            var inviteAgentsItem = new TSSettingsItems {
                EntryData = new TableData {
                    Title = "Invite Agents"
                },
                OnClickAction = "PushInvite"
            };
            SettingsTableData.Add (inviteAgentsItem);

            var FooterView = new UIView (new CGRect (0, 0, View.Frame.Width, 100));
            FooterView.BackgroundColor = UIColor.White;

            var btnNew = new UIButton ();
            if (UserInterfaceIdiomIsPhone) {
                btnNew.Frame = new CGRect (TSPhoneSpec.ScreenWidth / 2 - 75, 50, 150, 50);
            } else {
                btnNew.Frame = new CGRect (tblSettingsIPad.Frame.Size.Width / 2 - 75, 25, 150, 50);
            }
            btnNew.SetTitle ("+ Adds Account", UIControlState.Normal);
            btnNew.SetTitleColor (UIColor.FromRGB (0, 32, 70), UIControlState.Normal);
            btnNew.Font = UIFont.SystemFontOfSize (15.0f);
            btnNew.TouchUpInside += (object sender, EventArgs e) => {
                Console.WriteLine("Add account clicked");
                if (UserInterfaceIdiomIsPhone) {
                    this.NavigationController.PushViewController(new TSAccountBasicView("AddnewAccount"),true);
                }else{
                    var obj= new TSAccountBasicView("AddnewAccount");
                    AddPartialView(obj.GetAcocuntBasicsView ());
                }
            };
            FooterView.Add (btnNew);

            var TableViewSource = new TSSettingsTableSource (this, SettingsTableData);

            if (UserInterfaceIdiomIsPhone) {
                tblSettings.SeparatorInset = new UIEdgeInsets (0, 0, 0, 0);
                tblSettings.BackgroundColor = UIColor.White;
                tblSettings.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine;
                tblSettings.TableFooterView = FooterView;
                tblSettings.Source = TableViewSource;
                tblSettings.ReloadData ();
            } else {

                tblSettingsIPad.SeparatorInset = new UIEdgeInsets (0, 0, 0, 0);
                tblSettingsIPad.BackgroundColor = UIColor.White;
                tblSettingsIPad.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine;
                tblSettingsIPad.TableFooterView = FooterView;
                tblSettingsIPad.Source = TableViewSource;
                tblSettingsIPad.ReloadData ();
                SetAccountBasicLayoytIPad ();
            }
            //	View.AddSubview(ChangeLoginTableView);
        }
Exemplo n.º 5
0
		public override void RowSelected (UITableView tableView, Foundation.NSIndexPath indexPath)
		{
			tableView.DeselectRow (indexPath, true);
			foreach (var item in tableView.VisibleCells) {
				var _cell=(TSSettingsTableViewCell)item;
				_cell.TextLabel.TextColor = UIColor.Black;
				}
			var cell = (TSSettingsTableViewCell)tableView.CellAt (indexPath);
			cell.TextLabel.TextColor = UIColor.Orange;
			cell.SelectedBackgroundView.BackgroundColor = UIColor.Clear;
			var imgView = new UIImageView (new CGRect(0,0,20,20));
			imgView.HighlightedImage = new UIImage ("arrow.png");
			//cell.AccessoryView = imgView;


			var changeLoginGroup = GroupedData [indexPath.Section];
			var changeLoginEntry = changeLoginGroup.ElementAt (indexPath.Row);
			if (changeLoginEntry.OnClickAction != null) {
				if (TSPhoneSpec.UserInterfaceIsPhone) {
					if (changeLoginEntry.OnClickAction.Equals ("PushAccountbasic")) {
						controller.NavigationController.PushViewController (new TSAccountBasicView (), true);
					} 
					else if (changeLoginEntry.OnClickAction.Equals ("PushSetupCodes")) {
						controller.NavigationController.PushViewController (new TSSetupCodeVC (), true);
					}
					else if (changeLoginEntry.OnClickAction.Equals ("PushDepartments")) {
						controller.NavigationController.PushViewController (new TSDepartmentsVC (controller), true);
					}
					else if (changeLoginEntry.OnClickAction.Equals ("PushInvite")) {
						controller.NavigationController.PushViewController (new TSInviteAgentVC (), true);
					}
					else if (changeLoginEntry.OnClickAction.Equals ("PushAdvanced")) {
						controller.NavigationController.PushViewController (new TSAdvancedVC (), true);
					}
				} else {
					if (settingVC == null)
						settingVC = new TSSettingsView ();
					if (changeLoginEntry.OnClickAction.Equals ("PushAccountbasic")) {
						//UITableViewCell cell = tableView.CellAt (indexPath);
//						cell.BackgroundColor = UIColor.FromRGB (220, 220, 220);
//						cell.TextLabel.TextColor = UIColor.Orange;
//						controller.SetAccountBasicLayoytIPad ();
						var obj= new TSAccountBasicView();
						controller.AddPartialView(obj.GetAcocuntBasicsView ());
					}
					else if (changeLoginEntry.OnClickAction.Equals ("PushSetupCodes")) {
						//controller.NavigationController.PushViewController (new TSSetupCodeVC (), true);
						var obj= new TSSetupCodeVC();
						controller.AddPartialView(obj.GetSetupView ());
					}
					else if (changeLoginEntry.OnClickAction.Equals ("PushDepartments")) {
						//controller.NavigationController.PushViewController (new TSDepartmentsVC (), true);
						var obj= new TSDepartmentsVC(controller);
						controller.AddPartialView(obj.GetDepartmentView ());
					}
					else if (changeLoginEntry.OnClickAction.Equals ("PushInvite")) {
						//controller.NavigationController.PushViewController (new TSInviteAgentVC (), true);
						var obj= new TSInviteAgentVC();
						controller.AddPartialView(obj.GetInviteAgentView ());
					}
					else if (changeLoginEntry.OnClickAction.Equals ("PushAdvanced")) {
						//controller.NavigationController.PushViewController (new TSAdvancedVC (), true);
						var obj= new TSAdvancedVC();
						controller.AddPartialView(obj.GetAdvanceView ());
					}
				}
			}
		}