문제

I am using FlipView control for flipping through various pages i.e. *.XAML pages. I am using ObservableCollection of Page class. Now one page among those pages contains AppBar, but that AppBar can be open in any other XAML page from collection also. How can I prevent the opening of AppBar in all pages ?

Easy Explanation:- I have four XAML pages.

(1) MainPage.xaml (Contains only FlipView and ObservableCollection of Page class)

(2) PageWithAppBar.xaml (AppBar is in this page)

(3) PageWithoutAppBar.xaml

(4) PageWithoutAppBar2.xaml

Now through flipview, when I flip on PageWithoutAppBar.xaml or PageWithoutAppBar2.xaml and press right click then AppBar of PageWithAppBar.xaml become visible so I don't want that thing, how can I prevent that ?

What I have tried till now ?

I have created function to check in which page the AppBar should be visible. I tried to set

Visibility = Collapsed,

IsOpen = false,

this.BottomAppBar = null,

IsEnable = false

then also it appears

도움이 되었습니까?

해결책

It looks like the Page.BottomAppBar applies to the main container page - regardless of where it is declared. Given this, I'm not sure it is a good idea to use AppBars this way.

Perhaps you may want to create your own control that behaves like an appbar and make it work the way you want? Have a look at :WinRT XAML Toolkit on Codeplex . There is a CustomAppBar control in there, which might work for you.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top