locked
Not able to override AppBarButtonStyle RRS feed

  • Question

  • User392795 posted

    So, far I have had major luck in overriding PaneButtonStyle and some single style setters for TextBlocks and SolidColorBrush. The trick is to just redefine them in App.Xaml with the same x:key as the original style. Now, I tried the same with AppBarButtonStyle with this: https://stackoverflow.com/a/55470551.

    Is there a way to override it with a custom renderer as well, like done here: https://forums.xamarin.com/discussion/151174/can-not-override-pivotheaderitem-uwp#latest, for TabbedPageStyle??

    Wednesday, April 22, 2020 3:25 AM

All replies

  • User394095 posted

    I tried to set in App.xaml.c like this: ((Style)this.Resources["AppBarButtonStyle"]).Setters[0] = ((Style)this.Resources["MyAppBarButtonStyle"]).Setters[0];

    But it throws a run time exception: Cannot find a resource with the given key: AppBarButtonStyle.'

    Wednesday, April 22, 2020 3:46 AM