[英]Xamarin Forms Windows Phone MasterDetailPage - Remove default ApplicationBar icon
When using a MasterDetailPage in Xamarin Forms, the Windows Phone renders this as a Panel which displays by hitting an icon on the ApplicationBar. 在Xamarin Forms中使用MasterDetailPage时,Windows Phone会将其呈现为Panel,通过单击ApplicationBar上的图标进行显示。 Is there anyway to remove this icon and hookup the panel display event to a different button?
无论如何,有没有删除此图标并将面板显示事件连接到其他按钮的方法?
You can access the application bar via the Application Context. 您可以通过“应用程序上下文”访问应用程序栏。 For example:
例如:
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
var app = (MainPage)((PhoneApplicationFrame)Application.Current.RootVisual).Content;
var applicationBar = app.ApplicationBar;
applicationBar.Buttons.Clear();
base.OnElementPropertyChanged(sender, e);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.