コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            FilterBtn.TouchUpInside += (object sender, EventArgs e) =>
            {
                PresentModalViewController( new DateFilterViewController(), true);
            };

            // Perform any additional setup after loading the view, typically from a nib.
            this.ResultTitle.Text = "LookingForMatchingDates_String".Localize();

            this.FilterBtn.TouchUpInside += (object sender, EventArgs e) =>
            {

            };

            this.ResultList.RegisterNibForCellReuse (UINib.FromName (MatchingDatesCell.Key, NSBundle.MainBundle), MatchingDatesCell.Key);
            dataSource = new MatchingDatesTableSource ();
            ResultList.Source = dataSource;
            ResultList.RowHeight = 64;
            LettuceServer.Instance.GetMatchingDatesForUser((dateList) => {
                if (dateList != null) {
                    InvokeOnMainThread(() => {
                        dataSource.SetDateList(dateList, ResultList);
                        ResultList.ReloadData();
                        this.ResultTitle.Text = String.Format("FoundMatchingDates_String".Localize(), dateList.Count);
                        refreshNeeded = false;
                    });
                }
            });
        }
コード例 #2
0
        public void ConformToRecord(MatchingDate theDate, MatchingDatesTableSource theSource)
        {
            parentSource = theSource;
            PinBtn.TouchUpInside -= HandleClick;
            linkedDate = theDate;
            PinBtn.Hidden = false;
            SelfieView.Hidden = false;
            DateTimeLabel.Hidden = false;
            DateTimeLabel.Text = linkedDate.starttime.ToString ("g");
            DateTitleLabel.Text = linkedDate.title;
            if (!String.IsNullOrEmpty (linkedDate.selfie))
                SelfieView.SetImage (new NSUrl (linkedDate.selfie));
            else
                SelfieView.Image = UIImage.FromBundle ("LaunchIcon");

            if (theDate.applied) {
                PinBtn.SetTitle ("interested", UIControlState.Normal);
            } else if (theDate.pinned) {
                PinBtn.SetTitle ("unpin", UIControlState.Normal);
            } else {
                PinBtn.SetTitle ("pin", UIControlState.Normal);
            }
            PinBtn.TouchUpInside += HandleClick;
        }