I am working on Xamarin forms shared project with a master detail page. When I run the app the master detail page is the first item that loads yet it shows the back button which once clicked opens the navigation (master) drawer. This makes no navigation sense whatsoever! I have tried to hide the back button but have not been able to do this. Has anyone come across this and succeeded in doing this? I would prefer a programmatical solution rather than a xaml one.
I have tried adding the below code:
NavigationPage.SetHasBackButton(this, false);
But this doesn't work. I want to keep the toolbar as I will be adding my own menu items here but want the back button gone.
Try this:
NavigationPage.SetBackButtonTitle(this, string.Empty);
NavigationPage.SetHasBackButton(this, false);
Related
I want to enable and disable the bars and gesture of the master detail page (basically the whole menu) so that the user can't navigate when opening a certain page. I tried using a modal page to achieve this but I really need the toolbar menu of the navigation page.
How can I achieve that?
use IsGestureEnabled
IsGestureEnabled = false;
Setting the IsGestureEnabled property of the MasterDetailPage to true in the OnAppearing event and false in the OnDisappearing event of each DetailPage, seems giving the expected results.
if IsGestureEnabled = false; Property is working in Android. But not in iOS.you could use CustomRenderer ,you could refer to the workaround
I have a Xamarin Forms application, which has 2 buttons on the toolbar. Currently I'm using FreshMVVM (and it's navigation). I want to load pages without putting them into the navigation. I do not want to have the 'back' button on the toolbar, also I do not want the user return the last page.
Here's how I push a page currently:
CoreMethods.PushPageModel<FirstChoicePageModel>();
I tried to push as a modal, but that way the toolbar buttons does not work until I press back. Should I make new navigation containers and switch to them if I push the buttons?
It's been a little while since I've used FreshMVVM, but if I recall correctly, you have 2 options:
If you want to completly reset the nav stack, you can do CoreMethods.PushPageModelWithNewNavigation<FirstChoicePageModel>();
If you want to keep the nav stack, you can set NavigationPage.SetHasBackButton(this, false); in the code behind of the view.
For both of these options, it may necessary to intercept the back button on Android. In the code behind there is an overrideable method:
protected override bool OnBackButtonPressed()
{
return true; // prevent Xamarin.Forms from processing back button
}
If you want to show a page, but you doesn't want to navigate (change the current page), you can always use Popups.
See this link https://github.com/rotorgames/Rg.Plugins.Popup
I want to display a PopUp in my C# universal app like this :
but the problem,is that my PopUp deosn't work like this Frame that appears in the Groove App,per example,what I want is when I click on a button in the MainPage, it displays the PopUp then to disable the click on any element in the MainPage,the focus will be only on the elements of the Popup until the close of this PopUp
is this possible??
thanks for help
What you want is a modal window, for example you can create one with Content dialog.
ContentDialog modalWindow = new ContentDialog()
{
Title = "youTitle",
Content = "Content",
PrimaryButtonText = "
};
await modalWindow.ShowAsync();
You can show more here
Actually, the "PopUp" you've seen in the Groove App is not a Popup. It's a AccountsSettingsPane. This class provides methods to show the accounts pane and also to enable the app to register callbacks when the accounts flyout is about to be displayed. For more information, please refer to the official Web account management sample in GitHub and especially the Single Microsoft Account scenario in this sample.
When using AccountsSettingsPane, if we use the ProcessMonitor to track this UI, we will find that it is a system app C:\Windows\SystemApps\Microsoft.AccountsControl_cw5n1h2txyewy. What happened here is similar to this case: UWP Modal Window. So you can refer to Launch an app for results to implement this behavior. But this requires you to create another app.
For ContentDialog, it can not be movable. If your content is not complex, you can try with MessageDialog class. This dialog is movable. For more info, please refer to Message dialog sample.
I have a weird issue. I am not sure what I am doing wrong. I am doing a Windows Phone 8.1 Silverlight app project that (for now) has two pages. Page1.xaml has a Welcome page with a button, that, when clicked takes you to a second page with two textblocks one LongListSelector and one textbox,that accepts only numbers (InputScope="Number"). The LongListSelector is for selecting countries and it has it's own logic of the alphakeygroups and everything else (JumpList, GroupHeader, ItemTemplate). For the click event of the button in page1, this is what I've put in
NavigationService.Navigate(new Uri("/Page2.xaml", UriKind.Relative));
This is supposed to take me to the page two but it doesn't. Here're the errors I get:
after I click Continue twice (the Emulator button changes to Continue), I get this:
I tried with a dummy page, Page3_test.xaml, and that works fine. When I click the button on page1, it takes me to page3.
What am I doing wrong?
VS2013 - U4; W8.1;
I want to display an intro view (tutorial) on my monotouch app that when the user clicks on a button will take them to the main storyboard, which contains a UITabController.
I'm new to monotouch and can't work out how to do this. I'm adding an extra view that's been created to the tab bar controller in the AppDelegate.FinishedLaunching, but this always adds the button to the tab bar.
When the user has clicked the button once I don't want to show the intro page ever again, it's a one time deal (I'll save some value to disk to work this out), so I don't want to just add it to the tab controller.
Incidentally if anyone can show me where monotouch decides that it's going to start with the storyboard please let me know. The only thing I've found is the little start arrow that you drag around in XCode, but what if I have two storyboards and I want to load one based on the user being logged in or something.
You need to create simple entry ViewController with the button (Controller1). The next controller in storyboard will be the tabcontroller (TabController).
Thus you will always has the first entry screen in your application.
If you don't want to show it later than make transition from Controller1 to TabController before it is loaded. For example, override the ViewWillAppear method.
The second approach. Use this code to launch whatever you want view above all your controllers at any time:
UIViewController root= UIApplication.SharedApplication.KeyWindow.RootViewController
UIView myCustomView=new MyCustomView();
root.Add(myCustomView);
//call myCustomView.RemoveFromSuperview() and it will be dismissed