Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Convert PreferenceFragment into CustomRenderer to use in Forms

$
0
0

I have created a preference fragment in android and i can start the preference activity with dependency service but then the new page does not get into the navigation stack of the navigation page.

So i created a custom renderer to convert the fragment to a view to load into a contentpage but i am stuck on how to do that.

This is what i have until now:

        public class CustomPreferencesRenderer : ViewRenderer
            {
                protected override void OnElementChanged(ElementChangedEventArgs<View> e)
                {

                    base.OnElementChanged(e);

                    if (e.OldElement != null) return;

                    var prefFragement = new PrefFragment();


                    this.SetNativeControl(prefFragement.View);
                }

            }

Viewing all articles
Browse latest Browse all 58056

Trending Articles