سؤال

Ok, another question about Cimbalino appbar.

I have a pivot with several pages as UserControls. What i want is to have different appbars for every UC (page). But i can't define appbar inside UC, because that throws exception "This ApplicationBarBehavior element can only be attached to the LayoutRoot element", but root is Pivot itself.

PS: definitely i'd like to use mvvm way, and keep appbar in UC's viewmodels, not switching through SelectedIndex in Pivot's codebehind.

هل كانت مفيدة؟

المحلول

Ah, looking like MultiApplicationBarBehavior is to the resque. http://www.pedrolamas.com/2013/03/11/cimbalino-windows-phone-toolkit-multiapplicationbarbehavior/

Though, i'm not sure that it is 100% usefull: it is binded to index, but what if i'd like to switch some pages?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top