A Microsoft platform for building and publishing apps for Windows devices.
Hello,
Welcome to Microsoft Q&A!
The BackButton you want to deal with is not directly accessible, because it is not the current page (Frame1 or Frame2) controls. If you want to access it, you need to do some processing:
1. Change the accessibility of the control to "Public"
<CommandBar>
<CommandBar.Content>
<Button Name="BackButton" ...
x:FieldModifier="Public"/>
</CommandBar.Content>
</CommandBar>
2. Since the control is in MainPage, you need to create an accessible instance of MainPage
public static MainPage Current;
public MainPage()
{
this.InitializeComponent();
Current = this;
}
After that, you can access the control through MainPage.Current.BackButton.
Thanks.