App.Query syntax/documentation - e.g. get the immediate parent of an element

JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

The documentation refers to the 'fluent API' but there doesn't seem to be any documentation on the API itself.

Specifically, given the following element structure in a TableView:

[AppointmentListCell]
        [UITableViewCellContentView]
          [UIImageView]
          [UILabel] text: "02/11/14 15:00"
          [UILabel] text: "Pending"
          [UILabel] text: "Mr Jones, 1 Little Lane, Bitterne, Wilts, PO19 1GG"
          [UILabel] text: "Q4"
          [UIView]

I need to be able to tap the AppointmentListCell - as it has no identifier, I presume I must locate one of its children, and then walk up the hierarchy to get the AppointmentListCell.

Alternatively - how do I locate the top AppointmentListCell in the current UIWindow?

Best Answer

Answers

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

    @SimonS - thank's that's really useful. It's all about how to use the fluent language! I like your solution.

    What is the screenshot from? I presume Visual Studio or Xamarin Studio, to get the completion/help? When exploring the currently displayed elements using repl() in an OS X terminal, we don't get completion of course.

  • SimonSndergaardSimonSndergaard DKXamarin Team Xamurai

    James,

    The screen-shot is from Xamarin Studio, but Visual Studio looks almost the same. The Repl will show completion options on both windows and OSX, but not the doc comments.

    Br,
    /Simon

  • iltafkhalidiltafkhalid USMember

    I want to create an automated browser on iOS using xamarin. I have come to know that WKWebView will server my purpose. I have written code in ViewController function, viewDidLoad() as under:
    base.ViewDidLoad();
    // Perform any additional setup after loading the view, typically from a nib.
    WKWebView webView;

            webView = new WKWebView(View.Frame, new WKWebViewConfiguration());
            View.AddSubview(webView);
            //webView.ScalesPageToFit = true;
    
            var url = new NSUrl("https://www.google.com");
            var request = new NSUrlRequest(url);
            webView.LoadRequest(request);
    

    Now I am unable of how to user AppQuery class. An example for a starter will be nice.

  • EvgenyPopovEvgenyPopov USMember

    I have the same problem with WKWebView.

Sign In or Register to comment.