NSInvalidArgumentException on DataTemplate(typeof(ImageCell))

JorgeMarrufoJorgeMarrufo USUniversity ✭✭

I have the following code.

    {
        List<MenuItem> data = new MenuListData ();

        ItemsSource = data;
        VerticalOptions = LayoutOptions.FillAndExpand;
        BackgroundColor = Color.Transparent;

        => var cell = new DataTemplate (typeof(ImageCell));
        cell.SetBinding (TextCell.TextProperty, "Title");
        cell.SetBinding (ImageCell.ImageSourceProperty, "IconSource");

        ItemTemplate = cell;
    }

After it executes the marked line (=>) I am getting a FoundationMonoTouchException. and reads as follows.

Objective C exception thrown. Name: NSInvalidArgumentException
Reason: Application tried to present a modal view controller on itself.
Presenting controller is

public MenuListView ()

I cannot figure out why

Posts

  • rene_ruppertrene_ruppert DEXamarin Team, University, XamUProfessors Xamurai

    The code above won't create this issue. A piece is missing. I presume you are trying to present a modal dialog somewhere. Do you have a complete self contained example to demonstrate the effect?

Sign In or Register to comment.