Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

var b = new BindingContext(this, myClass, "MyClass") crashes simulator with no reported errors

$
0
0

I'm trying to keep this simple, building a proof of concept for management. I am just trying to generate a new dialogviewcontroller to show based on a simple class and am not getting any errors I can see. I've just upgraded to MonoTouch 6.0.6 with the same outcome. Tracing through the code I can validate that myClass is properly formed and populated right before the call...any help is appreciated!

Below is the entire MemberSource.cs file. Crash is in RowSelected()


using System; using MonoTouch.UIKit; using MonoTouch.Foundation; using System.Collections.Generic; using System.Windows; using MonoTouch.Dialog;

namespace WMMI.EDWBrowser { public class MemberSource : UITableViewSource { private List data; private UINavigationController parentnavcontroller;

    public MemberSource ( List<Member> memberData)
    {
        data = memberData;
    }

    #region implemented abstract members of MonoTouch.UIKit.UITableViewSource
    public override int RowsInSection (UITableView tableview, int section)
    {
        return data.Count;
    }

    public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
    {

        var cell = tableView.DequeueReusableCell ("cell");
        if (cell == null) 
            cell = new UITableViewCell(UITableViewCellStyle.Default, "cell");

        var text = string.Format ("{0}", data[indexPath.Row].Member_Full_Name);
        cell.TextLabel.Text = text;

        return cell;

    }

    public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
    {

        var members = new List<Member>();
        Member member = new Member();           

        members = member.GetMembersByName ("test");
        member = members[0];
        try {
            var binding = new BindingContext(this, member, "Member Details");
            var dialogViewController = new DialogViewController(binding.Root);
            dialogViewController.Title = "Member Details";
            parentnavcontroller.PushViewController(dialogViewController, true);
        } catch (Exception ex) {
            Console.WriteLine (ex.ToString ());
        }


    }

    public override int NumberOfSections (UITableView tableView)
    {
        return data.Count;
    }


    #endregion
}

}


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>