proper way to implement a "log out" menu item in react-navigation-drawer? - react-native

I have a basic implementation of react-navigation-drawer up and running in my RN app. The drawer displays menu items based on the titles of the configured components. I have a functional "Log Out" button on one of my screens but I need to move the log out functionality to a new "Log Out" menu item in the drawer.
So up to this point, my react-navigation-drawer has displayed menu items based on concrete components. The new twist is that I need to display an additional "Log Out" menu item which does not have a corresponding screen. I'm sure that this is a very common use case so I'm just looking for suggestions from other developers who have handled this scenario before?

Related

Is there a way to automatically change the selected menu page in a master detail project when the detail changes?

Background:
My project uses the "Master Detail" project from Xamarin.Forms, so it comes equipped with the hamburger menu button in the top left which is supposed to be the main source of navigation throughout the app. However, my app requires the user to go through multiple of those screens without the use of the hamburger menu. But when a user uses my own buttons to change the detail, the hamburger menu still says the user is on the previous page.
For example, a user is on Page A. They click a button outside of the menu which sends them to Page B. The menu will still show Page A.
My Attempt:
I really didn't know where to start, so I tried taking the MenuItemType and passing it through the following function:
// This changes the screen without changing the menu and it works.
((MasterDetailPage)Application.Current.MainPage).Detail = new NavigationPage(new PageB());
// This was my attempt to change the menu.
(Application.Current.MainPage as MenuPage).RootPage.NavigateFromMenu((id)MenuItemType.PageB);
But that returned a Null Reference Exception when run.
I've also tried manually calling the list view associated with the hamburger menu and changing the selectedItem property, but that didn't work either. Is there any way to change the selected menu?
For Clarity:
Since StackOverflow won't let me post a video, here's a link to how the app acts. As you can see, I use the Menu to go to the "About" Page. I click a button on the screen which takes me back to the "Browse" Page. However, when I open the menu, it still says "About" is selected. I can't reselect "About" until the menu moves away, meaning I have to reopen "Browse" despite already being on that screen.
What I'm looking for is a function which will automatically change the selected menu item to "Browse" when I press that button on the "About" Page. The app is currently using a Master Detail Page which has the "Detail" component changing from the About Page to the Browse Page. The menu page is a Content Page which came built with the app beforehand.

How can I make a navigation bar that navigates between pages in VB.NET?

I want to make a program that has a couple of categories on the top that you can navigate through. for instance: 'Home' 'Patients' 'Appointments' 'History' etc..
Every category you click shows its own buttons and labels on the screen.
(Just like the categories you see when you go to the Properties of any file on the desktop: 'General' 'Sharing' 'Security' 'Previous Versions' ...)
How do I do that?
If I put all the buttons and labels on the screen and just change their .Visible from True/False based on what category I click, you can see the controls appear and disappear in runtime which is not the correct way to do this obviously.
Any suggestions? is there a Tool that I can use?
Sincerely,
Not sure what you meant, but you should consider using the MDI Application design.
Basically it allows you to create a program in which multiple forms can appear, and each form has its own controls. Most of the time, these type of application use a menu bar, for an easy navigation throughout the program.

Dont hide a menu/menuitem on click

I am using vb.net and don't want to use WPF.
I have a menustrip having many menus.
These menus have many menuItems.
When I click on any menuItem I show a new form to the user.
When user finish his work and return to the main form he should be able to see the menu as it was while he left the main form.
I mean when I click on a menuItem the menu closes. But I don't want it to close.
It will likely be more confusing for your users having a menu that never closes because it defies expected behaviour. You are better off using one of the other controls suggested.
Every Operating System (Windows, Mac etc) define a standard set of controls for a reason - to enforce consistency and predictability across multiple applications. It's why you know to look to the menu to find a command. Microsoft, Apple etc all produce "design standards" documents that specify a baseline for the way that your user interacts with your app.
If a user selects something from the menu and the menu never closes, the user could well think that your application is broken.

Form sent to back on interaction with menu item

I've got two forms, one being frmMain and the other being frmDatasets. The idea is that frmDatasets is used to manage the application's datasets (it's a program for comparing sorting algorithms).
I have a MenuStrip on frmDatasets with a few items. I just decided to change the Add Dataset item to a drop-down menu with options for loading one from file, or generating one according to certain parameters. All well and good; just add the items, swap some icons around, and change the event handler's signature to handle the right Click event.
Except when I run the program, clicking on the Add Datasets top-level item for the first time sends frmDatasets to the back, displaying an inactive frmMain. Clicking the item again shows the dropdown menu as usual.
If I instead click another top-level menu item, that works just fine. But then simply hovering my mouse over the Add Dataset item causes the 'send to back' thing to happen.
I say "send to back", but it's really just putting it behind frmMain. It remains in front of other windows like Visual Studio and Firefox.
Anyone know what on Earth is going on with this form?
EDIT: If I show frmDatasets as a modal dialog, it stops the whole "sending to back" thing, but I still have to click the menu item twice before it shows the list.
EDIT2: Overriding the onClick event to call mnuAddDatasetDropDown.ShowDropDown removes the double-click issue, but it's only a solution if I keep the form as a modal dialog. Still gets sent to back. Overriding mouseEnter doesn't do anything to solve it.
Setting the TopMost property of frmDatasets from its Design view to 'true' fixed all of the problems I was having. No insight as to what was going on, unfortunately, but if anyone else is having this problem then hopefully it'll work for them too.

How do I implement this type of dynamic UI in a Razor view?

I will start by saying that I am an absolute newbie to web development and to MVC as well.
I want to implement a view for a Subscriber page (part of an MVC4 application dealing with Email marketing). What I want to implement is:
1) When the user clicks the "+ Add a List" button, a new Category should appear on the left and the cursor should blink, meaning it should be ready to receive the name for the category from the user. I also want that whenever the user hovers over any category name on the left, a small bar containing two buttons (edit and delete) should appear which should let the user edit the category name or delete that category. The thing I want is that all of these must happen without reloading the page.
2) When the user clicks the "+ Add Contact" button, a pop up dialog box containing two tabs should appear which lets the user either manually enter the details or upload a CSV to capture the details. Whenever the user clicks the "Add Contact" button or "Upload and Add Contacts" in the pop up dialog box, I want the new contacts to display in the contact list region shown in the picture (once again, without reloading the page). I also want the same hover bar for the contacts too (same as categories).
I am confused as to how to implement this in a Razor view? What do I use - JavaScript/jQuery/AJAX?
I am pretty much lost. Can someone please guide me a little bit so that I can continue and finish my first MVC4 project?
You need some javascript libraries like jQuery UI or maybe Kendo UI, I'd recommend to use jQuery UI at this time. they have many widgets but look at these. and keep in mind that a cshtml view can be look upon like a html page, you can have all tags, css and javascript you want there:
http://jqueryui.com/dialog/
http://jqueryui.com/tabs/
http://jqueryui.com/