简体   繁体   English

带有Caliburn的Windows Phone 8.1中的Pivot上的Appbar

[英]Appbar on Pivot in Windows Phone 8.1 with Caliburn

I have a Windows Phone 8.1 project, where the main view is a pivot. 我有一个Windows Phone 8.1项目,其中的主视图是枢轴。 The app has an applicationbar, which shows different items, depending on which pivotitem the user currently is. 该应用程序有一个应用程序栏,根据用户当前所在的枢轴项目显示不同的项目。 I also use the caliburn.micro 2 framework. 我还使用了caliburn.micro 2框架。

My problem is that I cannot change the AppBar when the user changes the current pivotitem. 我的问题是,当用户更改当前枢纽项目时,我无法更改AppBar。

I had different approaches to solve this problem: 我有不同的方法来解决此问题:

  • In WP8 i could set the "BindableAppBar" in the different PivotViews. 在WP8中,我可以在不同的PivotViews中设置“ BindableAppBar”。 With the AppBarConductor it was easy to manage this problem. 使用AppBarConductor可以轻松解决此问题。 But for WP8.1 the BindableAppBar is not available and I cannot find a built in AppBarConductor. 但是对于WP8.1,BindableAppBar不可用,而且我找不到内置的AppBarConductor。
  • It seems not possible to create the AppBar in the code behind, because then i cannot use other caliburn conventions (such as x:Name="Reload" --> calls Reload-Method in the ViewModel) 似乎不可能在后面的代码中创建AppBar,因为那样我就不能使用其他caliburn约定(例如x:Name =“ Reload”->在ViewModel中调用Reload-Method)
  • Google a lot 谷歌很多

Hope there is a better answer somewhere than "use the same AppBar in all pivotitems"...:-) 希望在某个地方有比“在所有数据透视表项中使用相同的AppBar”更好的答案... :-)

non-silverlight application (there is a huge difference)? 非Silverlight应用程序(有很大的区别)? BindableAppBar is a separate project not part of the assemblies for Caliburn.Micro. BindableAppBar是一个单独的项目,不属于Caliburn.Micro程序集的一部分。

http://blogs.msdn.com/b/thunbrynt/archive/2014/04/09/windows-phone-8-1-for-developers-application-bar.aspx , you might need to do things differently now that application bar is completely bindable! http://blogs.msdn.com/b/thunbrynt/archive/2014/04/09/windows-phone-8-1-for-developers-application-bar.aspx ,您现在可能需要以不同的方式进行操作酒吧是完全可以绑定的! since it is based off the Win8 bars. 因为它是基于Win8的。 You should still be able to move your pivot change event to viewmodel now. 您现在仍然应该可以将数据透视更改事件移至viewmodel。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM