public BasketViewController (Order order)
		{
			this.Title = "Your Basket";
			//This hides the back button text when you leave this View Controller
			this.NavigationItem.BackBarButtonItem = new UIBarButtonItem ("", UIBarButtonItemStyle.Plain, handler: null);
			TableViewSource source = new TableViewSource (this.order = order) {
				RowDeleted = CheckEmpty,
			};
			source.TrashButtonTapped += HandleTrashButtonTapped;
			TableView.Source = source;
			TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
			TableView.RowHeight = 75;
			TableView.TableFooterView = new UIView (new RectangleF (0, 0, 0, BottomButtonView.Height));
			this.View.AddSubview (BottomView = new BottomButtonView () {
				ButtonText = "Checkout",
				ButtonTapped = () => {
					if (Checkout != null)
						Checkout (this, EventArgs.Empty);
				}
			});
			CheckEmpty (false);
			totalAmount = new UILabel () {
				Text = "$1,000",
				TextColor = UIColor.White,
				TextAlignment = UITextAlignment.Center,
				Font = UIFont.BoldSystemFontOfSize (17),
			};
			totalAmount.SizeToFit ();
			this.NavigationItem.RightBarButtonItem = new UIBarButtonItem (totalAmount);
			UpdateTotals ();
		}
Ejemplo n.º 2
0
        public void SetupMainIndexSection(TableViewSource source)
        {
            var section1 = new TableViewSection(source);

            section1.Header = "MonoKit Sample Index";

            section1.Add(new DisclosureElement("Element Samples") { Command = this.GotoElementSamples });
            section1.Add(new DisclosureElement("Binding Samples") { Command = this.GotoBindingSamples });
            section1.Add(new DisclosureElement("Large Data Sample") { Command = this.GotoLargeDataSample });
            section1.Add(new DisclosureElement("Bind to Single Object") { Command = this.GotoBindToSingleObject });

            var section2 = new TableViewSection(source);

            section2.Header = "Test Samples";

            section2.Add(new DisclosureElement("Tasks Test") { Command = this.DoTaskTest });
            section2.Add(new DisclosureElement("Snapshot Domain Test") { Command = this.DoDomainTest2 });
            section2.Add(new DisclosureElement("Event Sourced Domain Test") { Command = this.DoDomainTest1 });
            section2.Add(new DisclosureElement("SQLite Admin Test") { Command = this.DoSqliteTest });
            section2.Add(new DisclosureElement("Custom Control") { Command = this.GotoCustomControl });
            section2.Add(new DisclosureElement("GC Tests") { Command = this.GotoGCTests });

            var section3 = new TableViewSection(source);

            section3.Header = "Utils";

            section3.Add(new StringElement("GC.Collect") { Command = this.DoGCCollect });
        }
		public StringTableViewController ()
		{
			TableView.Source = source = new TableViewSource (){
				Parent = this,
			};
			searchBar = new UISearchBar ();
			searchBar.TextChanged += (object sender, UISearchBarTextChangedEventArgs e) => {
				filteredItems = items.Where(x=> x.IndexOf(searchBar.Text, StringComparison.CurrentCultureIgnoreCase) >= 0).ToList();
				TableView.ReloadData();
			};
			searchBar.SizeToFit ();
			TableView.TableHeaderView = searchBar;
		}
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
			
			_activityView = new UIActivityIndicatorView(this.View.Frame);
			Add(_activityView);
			View.BringSubviewToFront(_activityView);
			
			var source = new TableViewSource(TableView);

			this.Bind (source, (TwitterViewModel vm) => vm.Tweets);
			this.Bind (_activityView, v => v.Hidden,(TwitterViewModel vm) => vm.IsSearching, "Visibility");
            
			TableView.Source = source;
			TableView.ReloadData();
        }
Ejemplo n.º 5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title = "Views";

            var tableSource = new TableViewSource(TableView);
            
            this.AddBindings(
                new Dictionary<object, string>()
                    {
                        { tableSource, "ItemsSource Items; SelectionChangedCommand ShowItemCommand" }
                    });

            TableView.Source = tableSource;
            TableView.ReloadData();
        }
Ejemplo n.º 6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
			
			_activityView = new UIActivityIndicatorView(this.View.Frame);
			Add(_activityView);
			View.BringSubviewToFront(_activityView);
			
			var source = new TableViewSource(TableView);

            var bindings = this.CreateBindingSet<TwitterView, TwitterViewModel>();
            bindings.Bind(source).To(vm => vm.Tweets);
            bindings.Bind(_activityView).For(v => v.Hidden).To(vm => vm.IsSearching).WithConversion("Visibility");
            bindings.Apply();
   
			TableView.Source = source;
			TableView.ReloadData();
        }
Ejemplo n.º 7
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            client = Amazon.AWSClientFactory.CreateAmazonCloudWatchClient (RegionEndpoint.USWest2);

            this.Title = "Cloud Watch";
            Source = new TableViewSource();
            TableView.Source = Source;
            addBtn = new UIBarButtonItem (UIBarButtonSystemItem.Add, delegate {
                AddItem();
            });
            refreshBtn = new UIBarButtonItem (UIBarButtonSystemItem.Refresh, delegate {
                Refresh();
            });

            UIActivityIndicatorView spinner = new UIActivityIndicatorView (new RectangleF (0, 0, 22, 22));
            spinner.StartAnimating ();
            loadingBtn = new UIBarButtonItem (spinner);
            ReloadUI();
            Refresh();
        }
        public override void ViewDidLoad ()
        {
            base.ViewDidLoad ();
            
            var foldingTvc = new FoldingTableViewController(TableViewHolder.Frame, UITableViewStyle.Grouped);
            
            // Perform any additional setup after loading the view, typically from a nib.
            var tableSource = new TableViewSource(foldingTvc.TableView);

            this.AddBindings(
                new Dictionary<object, string>()
                    {
                        { tableSource, "ItemsSource Emails" },
						{ foldingTvc, "RefreshHeadCommand RefreshHeadCommand; Refreshing IsRefreshingHead" },
                        { NumberOfEmailsLabel, "Text Emails.Count" }
                    });
                
            foldingTvc.TableView.Source = tableSource;
            foldingTvc.TableView.ReloadData();
			foldingTvc.TableView.RowHeight = 100.0f;
            
            Add(foldingTvc.View);			
        }
Ejemplo n.º 9
0
 protected TableViewSectionBase(TableViewSource source, params IViewDefinition[] viewDefinitions)
 {
     this.Source = source;
     this.viewDefinitions = new List<IViewDefinition>(viewDefinitions);
     this.Source.Add(this);
 }
Ejemplo n.º 10
0
 public TransactionsViewController(int recipientId)
     : base("TransactionsViewController", null)
 {
     this.recipientId = recipientId;
     this.tableSource = new TableViewSource();
 }
Ejemplo n.º 11
0
        public void OpenStringList(object sender, EventArgs e)
        {
            UIButton btnBankNoSearch = (UIButton)sender;
            ScreenUtils scnUtils = new ScreenUtils ();
            scnUtils.GetAbsolutePosition (btnBankNoSearch);
            float iTop = scnUtils.GetPositionTop ();
            float iLeft = scnUtils.GetPositionLeft ();
            int iBtnTagId = btnBankNoSearch.Tag;
            int iPwrIdRow = iBtnTagId / iEquipmentStringSearchTagId;
            int iStringRow = iBtnTagId - (iPwrIdRow * iEquipmentStringSearchTagId);
            int iSectionCounterTagId = iEquipmentRowSectionCounterTagId * iPwrIdRow  + iStringRow;
            UILabel hfSectionCounter = (UILabel)View.ViewWithTag (iSectionCounterTagId);
            int iSectionCounterId = Convert.ToInt32 (hfSectionCounter.Text);

            clsTabletDB.ITPValidHierarchy ITPHierarchy = new clsTabletDB.ITPValidHierarchy();
            string[] sSolarStringNos = ITPHierarchy.GetValidHierarchy(7);

            //Create a list and convert the string array to the list. Why the system cannot take a simple string array is beyond me!!!
            List<string> listStringNo = new List<string> ();
            Array.ForEach (sSolarStringNos, value => listStringNo.Add (value.ToString ()));

            TableViewSource tabdata = new TableViewSource (listStringNo, true);
            tabdata.SetFont("Verdana",10f);
            UITableView cmbStringNo = new UITableView ();

            //If the bottom of the frame would be outside the main content frame make it go upwards instead of downwards
            UILabel hfContentHeight = (UILabel)View.ViewWithTag (3);
            int iContentHeight = Convert.ToInt32 (hfContentHeight.Text);
            if (iTop + 190f > (float)iContentHeight)
            {
                cmbStringNo.Frame = new RectangleF(iLeft, iTop - 190f, 90f, 200f);
            }
            else
            {
                cmbStringNo.Frame = new RectangleF(iLeft, iTop, 90f, 200f);
            }

            tabdata.SetParent(cmbStringNo);
            tabdata.SetUpdateFieldType("UITextField");
            UITextField lblVwUpdate = (UITextField)View.ViewWithTag (iEquipmentStringTagId * (iPwrIdRow) + (iStringRow));
            tabdata.SetTextFieldToUpdate(lblVwUpdate);
            UIView vwUnsaved = (UIView)View.ViewWithTag (60);
            tabdata.SetUnsavedChangesView(vwUnsaved);
            tabdata.SetShowUnsavedOnChange(true);
            //Also set the section flag to 1 that it has changed and the overall flag that it has changed
            UILabel lblUnsavedFlag = (UILabel)View.ViewWithTag (80);
            tabdata.SetUnsavedChangesHiddenLabel(lblUnsavedFlag);
            UILabel lblUnsavedSectionFlag = (UILabel)View.ViewWithTag ((iSectionCounterId + 1) * iSectionStatusTagId);
            tabdata.SetUnsavedChangesSectionHiddenLabel(lblUnsavedSectionFlag);

            cmbStringNo.Source = tabdata;
            iUtils.SESTable thistable = new iUtils.SESTable();
            string sSelectedValue = lblVwUpdate.Text;
            thistable.SetTableSelectedText(cmbStringNo, sSelectedValue, sSolarStringNos, true);

            //Get the main scroll view
            UIScrollView scrollVw = (UIScrollView)View.ViewWithTag (2);
            scrollVw.AddSubview(cmbStringNo);
        }
Ejemplo n.º 12
0
        public void OpenModelList(object sender, EventArgs e)
        {
            UIButton btnModelSearch = (UIButton)sender;
            ScreenUtils scnUtils = new ScreenUtils ();
            scnUtils.GetAbsolutePosition (btnModelSearch);
            float iTop = scnUtils.GetPositionTop ();
            float iLeft = scnUtils.GetPositionLeft ();
            int iBtnTagId = btnModelSearch.Tag;
            int iPwrIdRow = iBtnTagId / iEquipmentModelSearchTagId;
            int iStringRow = iBtnTagId - (iPwrIdRow * iEquipmentModelSearchTagId);
            int iSectionCounterTagId = iEquipmentRowSectionCounterTagId * iPwrIdRow + iStringRow;
            UILabel hfSectionCounter = (UILabel)View.ViewWithTag (iSectionCounterTagId);
            int iSectionCounterId = Convert.ToInt32 (hfSectionCounter.Text);
            UILabel lblSupplier = (UILabel)View.ViewWithTag (iEquipmentMakeTagId * (iPwrIdRow) + (iStringRow));
            string sSupplier = lblSupplier.Text;

            if (sSupplier == "")
            {
                iUtils.AlertBox alert = new iUtils.AlertBox ();
                alert.CreateErrorAlertDialog ("You must select a make before you can select a model");
                return;
            }

            UILabel lblEquipmentType = (UILabel)View.ViewWithTag (iEquipmentTypeTagId * (iPwrIdRow) + (iStringRow));
            int iEquipmentType = Convert.ToInt32(lblEquipmentType.Text);

            //Create a list and convert the string array to the list. Why the system cannot take a simple string array is beyond me!!!
            List<string> listModel = new List<string> ();
            clsTabletDB.ITPInventory ITPInventory = new clsTabletDB.ITPInventory ();
            string[] sModels;
            switch(iEquipmentType)
            {
                case 3:
                    sModels = ITPInventory.GetRackModels (sSupplier);
                    m_sRackModels = sModels;
                    Array.ForEach (m_sRackModels, value => listModel.Add (value.ToString ()));
                    break;
                case 4:
                    sModels = ITPInventory.GetSubRackModels (sSupplier);
                    m_sSubRackModels = sModels;
                    Array.ForEach (m_sSubRackModels, value => listModel.Add (value.ToString ()));
                    break;
                case 5:
                    sModels = ITPInventory.GetPositionModels (sSupplier);
                    m_sPositionModels = sModels;
                    Array.ForEach (m_sPositionModels, value => listModel.Add (value.ToString ()));
                    break;
                case 7:
                    sModels = ITPInventory.GetSolarStringModels (sSupplier);
                    m_sSolarStringModels = sModels;
                    Array.ForEach (m_sSolarStringModels, value => listModel.Add (value.ToString ()));
                    break;
                default:
                    sModels = ITPInventory.GetPositionModels (sSupplier);
                    m_sPositionModels = sModels;
                    Array.ForEach (m_sPositionModels, value => listModel.Add (value.ToString ()));
                    break;
            }

            TableViewSource tabdata = new TableViewSource (listModel, true);
            tabdata.SetFont("Verdana",10f);
            UITableView cmbModel = new UITableView ();

            //If the bottom of the frame would be outside the main content frame make it go upwards instead of downwards
            UILabel hfContentHeight = (UILabel)View.ViewWithTag (3);
            int iContentHeight = Convert.ToInt32 (hfContentHeight.Text);
            if (iTop + 190f > (float)iContentHeight)
            {
                if (iLeft + 290f > 1000f)
                {
                    cmbModel.Frame = new RectangleF(iLeft - 300f, iTop - 190f, 290f, 200f);
                }
                else
                {
                    cmbModel.Frame = new RectangleF(iLeft, iTop - 190f, 290f, 200f);
                }
            }
            else
            {
                if (iLeft + 290f > 1000f)
                {
                    cmbModel.Frame = new RectangleF(iLeft - 300f, iTop, 290f, 200f);
                }
                else
                {
                    cmbModel.Frame = new RectangleF(iLeft, iTop, 290f, 200f);
                }
            }

            tabdata.SetParent(cmbModel);
            tabdata.SetUpdateFieldType("UILabel");
            UILabel lblVwUpdate = (UILabel)View.ViewWithTag (iEquipmentModelTagId * (iPwrIdRow) + (iStringRow));
            tabdata.SetLabelViewToUpdate(lblVwUpdate);
            UIView vwUnsaved = (UIView)View.ViewWithTag (60);
            tabdata.SetUnsavedChangesView(vwUnsaved);
            tabdata.SetShowUnsavedOnChange(true);
            UILabel hfRowStatus = (UILabel)View.ViewWithTag (iEquipmentRowStatusTagId * (iPwrIdRow) + (iStringRow));
            UILabel lblSPN = (UILabel)View.ViewWithTag (iEquipmentSPNHiddenTagId * (iPwrIdRow) + (iStringRow));
            tabdata.SetModelPostUpdate(6, hfRowStatus, lblSPN, sSupplier); //Here the 6 refers to the post update index and NOT batteries as the equipment type

            //Also set the section flag to 1 that it has changed and the overall flag that it has changed
            UILabel lblUnsavedFlag = (UILabel)View.ViewWithTag (80);
            tabdata.SetUnsavedChangesHiddenLabel(lblUnsavedFlag);
            UIButton btnSectionSave = (UIButton)View.ViewWithTag ((iSectionCounterId + 1) * iSaveSectionBtnTagId);
            tabdata.SetSectionSaveButton(btnSectionSave);
            UILabel lblUnsavedSectionFlag = (UILabel)View.ViewWithTag ((iSectionCounterId + 1) * iSectionStatusTagId);
            tabdata.SetUnsavedChangesSectionHiddenLabel(lblUnsavedSectionFlag);

            cmbModel.Source = tabdata;
            iUtils.SESTable thistable = new iUtils.SESTable();
            string sSelectedValue = lblVwUpdate.Text;
            switch(iEquipmentType)
            {
                case 3:
                    thistable.SetTableSelectedText(cmbModel, sSelectedValue, m_sRackModels, true);
                    break;
                case 4:
                    thistable.SetTableSelectedText(cmbModel, sSelectedValue, m_sSubRackModels, true);
                    break;
                case 5:
                    thistable.SetTableSelectedText(cmbModel, sSelectedValue, m_sPositionModels, true);
                    break;
                case 7:
                    thistable.SetTableSelectedText(cmbModel, sSelectedValue, m_sSolarStringModels, true);
                    break;
                default:
                    thistable.SetTableSelectedText(cmbModel, sSelectedValue, m_sPositionModels, true);
                    break;
            }

            //Get the main scroll view
            UIScrollView scrollVw = (UIScrollView)View.ViewWithTag (2);
            scrollVw.AddSubview(cmbModel);
        }
Ejemplo n.º 13
0
        public void OpenMakeList(object sender, EventArgs e)
        {
            UIButton btnMakeSearch = (UIButton)sender;
            ScreenUtils scnUtils = new ScreenUtils ();
            scnUtils.GetAbsolutePosition (btnMakeSearch);
            float iTop = scnUtils.GetPositionTop ();
            float iLeft = scnUtils.GetPositionLeft ();
            int iBtnTagId = btnMakeSearch.Tag;
            int iPwrIdRow = iBtnTagId / iEquipmentMakeSearchTagId;
            int iStringRow = iBtnTagId - (iPwrIdRow * iEquipmentMakeSearchTagId);
            int iSectionCounterTagId = iEquipmentRowSectionCounterTagId * iPwrIdRow + iStringRow;
            UILabel hfSectionCounter = (UILabel)View.ViewWithTag (iSectionCounterTagId);
            int iSectionCounterId = Convert.ToInt32(hfSectionCounter.Text);

            //Create a list and convert the string array to the list. Why the system cannot take a simple string arary is beyond me!!!
            UILabel lblEquipmentType = (UILabel)View.ViewWithTag (iEquipmentTypeTagId * (iPwrIdRow) + (iStringRow));
            int iEquipmentType = Convert.ToInt32(lblEquipmentType.Text);

            List<string> mylist = new List<string> ();
            clsTabletDB.ITPInventory ITPInventory = new clsTabletDB.ITPInventory ();
            string[] sMakes;
            switch(iEquipmentType)
            {
                case 3:
                    sMakes = ITPInventory.GetRackMakes ();
                    m_sRackMakes = sMakes;
                    Array.ForEach (m_sRackMakes, value => mylist.Add (value.ToString ()));
                    break;
                case 4:
                    sMakes = ITPInventory.GetSubRackMakes ();
                    m_sSubRackMakes = sMakes;
                    Array.ForEach (m_sSubRackMakes, value => mylist.Add (value.ToString ()));
                    break;
                case 5:
                    sMakes = ITPInventory.GetPositionMakes ();
                    m_sPositionMakes = sMakes;
                    Array.ForEach (m_sPositionMakes, value => mylist.Add (value.ToString ()));
                    break;
                case 7:
                    sMakes = ITPInventory.GetSolarStringMakes ();
                    m_sSolarStringMakes = sMakes;
                    Array.ForEach (m_sSolarStringMakes, value => mylist.Add (value.ToString ()));
                    break;
                default:
                    sMakes = ITPInventory.GetPositionMakes ();
                    m_sPositionMakes = sMakes;
                    Array.ForEach (m_sPositionMakes, value => mylist.Add (value.ToString ()));
                    break;
            }

            TableViewSource tabdata = new TableViewSource (mylist, true);
            tabdata.SetFont("Verdana",10f);
            UITableView cmbMake = new UITableView ();

            //If the bottom of the frame would be outside the main content frame make it go upwards instead of downwards
            UILabel hfContentHeight = (UILabel)View.ViewWithTag (3);
            int iContentHeight = Convert.ToInt32 (hfContentHeight.Text);
            if (iTop + 190f > (float)iContentHeight)
            {
                cmbMake.Frame = new RectangleF(iLeft, iTop - 190f, 290f, 200f);
            }
            else
            {
                cmbMake.Frame = new RectangleF(iLeft, iTop, 290f, 200f);
            }

            tabdata.SetParent(cmbMake);
            tabdata.SetUpdateFieldType("UILabel");
            UILabel txtVwUpdate = (UILabel)View.ViewWithTag (iEquipmentMakeTagId * (iPwrIdRow) + (iStringRow));
            tabdata.SetLabelViewToUpdate(txtVwUpdate);
            UIView vwUnsaved = (UIView)View.ViewWithTag (60);
            tabdata.SetUnsavedChangesView(vwUnsaved);
            tabdata.SetShowUnsavedOnChange(true);
            //Also set the section flag to 1 that it has changed and the overall flag that it has changed
            UILabel lblUnsavedFlag = (UILabel)View.ViewWithTag (80);
            tabdata.SetUnsavedChangesHiddenLabel(lblUnsavedFlag);
            UIButton btnSectionSave = (UIButton)View.ViewWithTag ((iSectionCounterId + 1) * iSaveSectionBtnTagId);
            tabdata.SetSectionSaveButton(btnSectionSave);
            UILabel lblUnsavedSectionFlag = (UILabel)View.ViewWithTag ((iSectionCounterId + 1) * iSectionStatusTagId);
            tabdata.SetUnsavedChangesSectionHiddenLabel(lblUnsavedSectionFlag);
            UILabel lblViewModel = (UILabel)View.ViewWithTag (iEquipmentModelTagId * (iPwrIdRow) + (iStringRow));
            tabdata.SetMakePostUpdate(1, lblViewModel);

            cmbMake.Source = tabdata;
            iUtils.SESTable thistable = new iUtils.SESTable();
            string sSelectedValue = txtVwUpdate.Text;
            switch(iEquipmentType)
            {
                case 3:
                    thistable.SetTableSelectedText(cmbMake, sSelectedValue, m_sRackMakes, true);
                    break;
                case 4:
                    thistable.SetTableSelectedText(cmbMake, sSelectedValue, m_sSubRackMakes, true);
                    break;
                case 5:
                    thistable.SetTableSelectedText(cmbMake, sSelectedValue, m_sPositionMakes, true);
                    break;
                case 7:
                    thistable.SetTableSelectedText(cmbMake, sSelectedValue, m_sSolarStringMakes, true);
                    break;
                default:
                    thistable.SetTableSelectedText(cmbMake, sSelectedValue, m_sPositionMakes, true);
                    break;
            }

            //Get the main scroll view
            UIScrollView scrollVw = (UIScrollView)View.ViewWithTag (2);
            scrollVw.AddSubview(cmbMake);
        }
Ejemplo n.º 14
0
        public void OpenItemsList(object sender, EventArgs e, UIView vwSearch, int iSectionCounterId)
        {
            clsTabletDB.ITPValidHierarchy ITPHierarchy = new clsTabletDB.ITPValidHierarchy();
            UILabel hfSearching = (UILabel)View.ViewWithTag (iSearchHiddenLabelTagId);
            int iSearchTypeId = Convert.ToInt32(hfSearching.Text);
            UILabel hfPwrIdRow = (UILabel)View.ViewWithTag (iPwrIdRowHiddenLabelTagId);
            int iPwrIdRow = Convert.ToInt32(hfPwrIdRow.Text);
            UILabel hfStringRow = (UILabel)View.ViewWithTag (iStringRowHiddenLabelTagId);
            int iStringRow = Convert.ToInt32(hfStringRow.Text);
            UITextField txtSearch = (UITextField)View.ViewWithTag(90);
            string sSearchText = txtSearch.Text;
            string[] sItems = ITPHierarchy.GetValidHierarchySearch(iSearchTypeId, sSearchText);
            int iTypeTagId = -1;
            int ihfTypeTagId = -1;

            switch (iSearchTypeId)
            {
                case 1:
                    iTypeTagId = iEquipmentFloorTagId;
                    ihfTypeTagId = iEquipmentFloorHiddenTagId;
                    break;

                case 2:
                    iTypeTagId = iEquipmentSuiteTagId;
                    ihfTypeTagId = iEquipmentSuiteHiddenTagId;
                    break;

                case 3:
                    iTypeTagId = iEquipmentRackTagId;
                    ihfTypeTagId = iEquipmentRackHiddenTagId;
                    break;

                case 4:
                    iTypeTagId = iEquipmentSubRackTagId;
                    ihfTypeTagId = iEquipmentSubRackHiddenTagId;
                    break;

                case 5:
                    iTypeTagId = iEquipmentPositionTagId;
                    ihfTypeTagId = iEquipmentPositionHiddenTagId;
                    break;

                case 7:
                    iTypeTagId = iEquipmentStringTagId;
                    ihfTypeTagId = iEquipmentStringHiddenTagId;
                    break;
            }
            //Create a list and convert the string array to the list. Why the system cannot take a simple string array is beyond me!!!
            List<string> listItems = new List<string>();
            Array.ForEach(sItems, value => listItems.Add(value.ToString()));

            TableViewSource tabdata = new TableViewSource(listItems, true);
            tabdata.SetFont("Verdana", 10f);
            if (m_cmbSearch == null)
            {
                UITableView cmbItems = new UITableView();
                cmbItems.Frame = new RectangleF(100f, 88f, 90f, 200f);
                cmbItems.Tag = iSearchTableTagId;
                m_cmbSearch = cmbItems;
            }

            m_cmbSearch.Hidden = false;
            tabdata.SetParent(m_cmbSearch);
            tabdata.SetUpdateFieldType("UITextField");
            UITextField lblVwUpdate = (UITextField)View.ViewWithTag (iTypeTagId * (iPwrIdRow) + (iStringRow));
            tabdata.SetTextFieldToUpdate(lblVwUpdate);
            UILabel lblhfVwUpdate = (UILabel)View.ViewWithTag (ihfTypeTagId * (iPwrIdRow) + (iStringRow));
            tabdata.SetSearchView(vwSearch);
            UIView vwUnsaved = (UIView)View.ViewWithTag (60);
            tabdata.SetUnsavedChangesView(vwUnsaved);
            tabdata.SetShowUnsavedOnChange(true);
            UILabel hfRowStatus = (UILabel)View.ViewWithTag(iEquipmentRowStatusTagId * iPwrIdRow + iStringRow);
            tabdata.SetItemPostUpdate(iSearchTypeId + 1, lblhfVwUpdate, hfRowStatus);

            //Also set the section flag to 1 that it has changed and the overall flag that it has changed
            UILabel lblUnsavedFlag = (UILabel)View.ViewWithTag (80);
            tabdata.SetUnsavedChangesHiddenLabel(lblUnsavedFlag);
            UIButton btnSectionSave = (UIButton)View.ViewWithTag ((iSectionCounterId + 1) * iSaveSectionBtnTagId);
            tabdata.SetSectionSaveButton(btnSectionSave);
            UILabel lblUnsavedSectionFlag = (UILabel)View.ViewWithTag ((iSectionCounterId + 1) * iSectionStatusTagId);
            tabdata.SetUnsavedChangesSectionHiddenLabel(lblUnsavedSectionFlag);
            m_cmbSearch.Source = tabdata;
            vwSearch.AddSubview(m_cmbSearch);
        }
Ejemplo n.º 15
0
 public MinionView(IntPtr handle)
     : base(handle)
 {
     this.lifetime = new CompositeDisposable();
     this.tableSource = new TableViewSource();
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MonoKit.UI.TableViewController"/> class.
 /// </summary>
 /// <param name='source'>
 /// The Table view source to use for the UITableView.
 /// </param>
 public TableViewController(UITableViewStyle tableStyle, TableViewSource source)
 {
     this.tableStyle = tableStyle;
     this.Source = source;
 }