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

How to call functions available in a ViewRenderer class?

$
0
0

I was able to call a function in a ViewRenderer class from another class in a platform specific project, but I dont feel its the right way to code this. Can you provide help on how to correctly code it?

        public class CustomWebViewRenderer : ViewRenderer<CustomWebView, Android.Webkit.WebView>
        {
            public static Android.Webkit.WebView staticWebView = null;

            public static void doSomeWork()
            {
            // do work with staticWebView
        }
        }


        public class ImageHelper : IImageHelper
        {
            public ConvertWebViewToImageAndSaveToDisk()
            {
            // Im calling the ViewRenderer class to do some work
            CustomWebViewRenderer.doSomeWork();
            }
        }

Viewing all articles
Browse latest Browse all 204402

Trending Articles