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

UWP ToolbarItem TextColor

$
0
0

Hi

I have a Xamarin.Forms app targeting iOS, Android and UWP. When I add some toolbaritems (secondary) and start the UWP on my Windows10 machine. The menu appears (when I cklick on the 3-dots-button), but the text is in white color.

This is because my ApplicationBar (with the title) has a blue background color and a white text.

I know, I can't change the color directly on the toolbaritem. But I thought about a renderer...

But how? Can anybody help me out?

My Renderer:

public class UwpBasePageRenderer : PageRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<Page> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null || Element == null) return;

            Loaded += OnLoaded;
        }

        private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
        {
            var mypanel = ContainerElement as Panel;

            // Something like this...
            // mypanel.ApplicationBar.TextColor = Black;

        }
    }

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>