want to call a method from Child Content view to parent convent view in xamarin forms

vinothswamivinothswami Member ✭✭
edited September 11 in Xamarin.Forms

Hello Geeks,
I placed a camera icon in the header which I made as a _custom _content view and it is shared to all other screens in the App.

my doubt is how can I call a method or variables in the parent content view when I took an image in its child content view (i.e custom layout)

Thank you in Advance.

Best Answer

  • vinothswamivinothswami ✭✭
    Accepted Answer

    @Jarvan simply telling want to call a method from child content view to its parent content view.

    Got the solution and the solution is a very simple thing.

    creating a ViewModel and the binding method or function will have access to both parent and child content view controls.

Answers

  • JarvanJarvan Member, Xamarin Team Xamurai

    I placed a camera icon in the header which I made as a _custom _content view

    Did you use control template to place the camera icon?

    how can I call a method or variables in the parent content view when I took an image in its child content view

    Please post the related code or share a basic demo to reproduce the issue. It'll help to get a solution.

  • vinothswamivinothswami Member ✭✭
    Accepted Answer

    @Jarvan simply telling want to call a method from child content view to its parent content view.

    Got the solution and the solution is a very simple thing.

    creating a ViewModel and the binding method or function will have access to both parent and child content view controls.

Sign In or Register to comment.