Пример #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();


            //public List<string> PhoneNumbers { get; set; }

            headingLabel.Text = "Enter A Phoneword";
            translateButton.SetTitle(@"Translate To Number", UIControlState.Normal);
            callButton.SetTitle(@"Call", UIControlState.Normal);
            callHistoryButton.SetTitle(@"Call History Button", UIControlState.Normal);

            translateButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                translatedNumber = PhoneTranslator.ToNumber(PhoneNumberText.Text);
                PhoneNumberText.ResignFirstResponder();

                if (translatedNumber == "")
                {
                    callButton.SetTitle(@"Call", UIControlState.Normal);
                    callButton.Enabled = false;
                }
                else
                {
                    callButton.SetTitle(@"Call " + translatedNumber, UIControlState.Normal);
                    callButton.Enabled = true;
                }
            };
            callButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                PhoneNumbers.Add(translatedNumber);
            };
            callHistoryButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // Launches a new instance of CallHistoryController
                CallHistoryController callHistory = this.Storyboard.InstantiateViewController("CallHistoryController") as CallHistoryController;
                if (callHistory != null)
                {
                    callHistory.PhoneNumbers = PhoneNumbers;
                    this.NavigationController.PushViewController(callHistory, true);
                }
            };
        }
Пример #2
0
 public CallHistoryDataSource(CallHistoryController controller)
 {
     this.controller = controller;
 }