I'm currently developing an app for Windows 8 which should provide nested navigation. The main view is split into 3 parts, a menu area on the left side, a Content area and a Header. Both the menu and the Header should be visible all the time.
The Content area is filled with the Content selected from the main menu, however if the user selects for example a list, the Content area is again split into two sections where i want to Show the list on the left side and the selected Detail Information on the right side (similar to the built-in mail app). The Detail view again has subviews, which should be displayed in the same area. I added a back button to navigate through the Detail views.
Each of the views is currently contained in a Frame element, which means i have a MenuFrame and ContentFrame inside the main view, and a ListFrame and a DetailFrame inside the "list"-view. I maintain backstacks for every Frame to enable navigating back.
My question is: if the user wants to snap the application (Display it side by side with other Win8-Apps or the Desktop), the space for the app is very small. Therefore i want to Display only one view at a time in snapped mode, which means the user first sees the main menu, then the list, then the Detail view, and he should be able to navigate back to the parent view in all cases (which means that i would have to maintain a single backstack for all views?).
Is there a simple way to achieve this behavior?
Another question: Currently i don't use the Frame.Navigate-methods, but i implemented my own backstack by just creating UserControls and assigning them to the Frame.Content property. If the app wants to navigate back, the previous control is popped from the stack and set as the Frame Content. The benefit of this is that i can execute code in the control constructor which might raise exceptions. Are there any downside of this method or other reasons why you would recommend switching to the standard Frame.Navigate() pattern?
Related
I am trying to create UI structure for Bootstrap admin template which contains left menu and right content section(Typically partial view) using MVC4.The application needs to accommodate more than 50 menus and it will increase dynamically in feature. So i have decided to go with below structure and i don't want to re-render left panel menus.I have top bar fixed header which will display lots of notification details with respect to user.My problems are i don't want to make API calls to get the notification details for every time when i click left menu which will fetch the details from lots of table in DB. So the only solution is not to refresh the left menu and top bar header(which are defined in Layout file). How can i achieve this.Any solution would be very helpful.
AJAX seems the solution as Stan suggested in the comment.
So first load jquery, then in the razor page render your content from an action (Html.Action) that returns a partial view.
Then when user clicks that menu item make a call from client with jquery to that action so you return PartialContentView, and replace the content section with server response.
I have a WPF query using the MVVM pattern. The first panel is a navigation area and the second panel is a tab area. Between both is the navigation button. If I click on the navigation button, then it will collapse the navigation area. If I again click this button again, then both the panels are visible.
So all I want to do is have their final state persist through application shutdowns. If the user collapses the navigation area, and closes the application, then next time they open the application, the navigation area should still be closed. I don't want to have to store this information in a DataBase.
How can I achieve this?
The sample look and feel of the image:
If you are using MVVM than you have a ViewModel for that View.
In that ViewModel you should have a command that will be executed when user clicks on Navigation button, so that you can decide what to do with Navigation Area
So basically you could store that info (is Navigation collapsed or not) in Application.Properties.Settings, see http://msdn.microsoft.com/en-us/library/aa730869%28v=vs.80%29.aspx
There you create property, e.g. IsNavigationAreaCollapsed of type boolean.
And when command is executed in code do this:
private void OnNavigationButtonExecution()
{
Properties.Settings.Default.IsNavigationAreaCollapsed = !Properties.Settings.Default.IsNavigationAreaCollapsed
CollapseNavigationArea(Properties.Settings.Default.IsNavigationAreaCollapsed); // this will collapse or not the navoigation area
Properties.Settings.Default.Save(); //save settings, so that it will be stored when app shutsdown
}
and in ViewModel constructor add code that will read a value from settings (Properties.Settings.Default.IsNavigationAreaCollapsed) and do this
CollapseNavigationArea(Properties.Settings.Default.IsNavigationAreaCollapsed);
I found one easy way of implementing it.
What I did is created an XML file (outside Bin folder obviously)
passed a default value for grid width to the XML file.
The function which is getting called at the application start I retrieved the value of Grid Width which I set default in XML file(for the first time I am passing a default value) with help of Linq To XML and stored this entry into a variable.
Now,I am passing this variable for Grid length.
Now, if the user collapse/expand the panel and closes the application then simply on Close function I am updating the value of XML.
I'm not even sure if I'm using the right terms for what I'm trying to do. But basically I have a personal organizer program with content that changes depending on what task you're doing, a calendar vs. contact list vs. todo list etc.
My searches keep bringing up "Navigation" but I'm not sure that this is what I'm after, as I don't want to be stuck going forwards and backwards between pages. I want the user to be able to click on a link or button and be able to jump to any point in the program. Am I better off just removing all the controls and adding the new ones each time? I'd like to keep it all within one window if possible.
If I were in your situation, I would use tabs. Set up an individual tab for each each "task" (calender, contact list, todo list). This way users are one click away from any task they want to navigate to.
You want to use user controls. Each user control is like a sub-page of controls. Then you keep the same master page and just switch user controls based on what you want to show. You can put the user controls on separate tabs if you like or you can put them one after the other and make them visible/invisible or you can load them dynamically with code like
myBorder.Child = new MyUserControl();
I would like to implement the following WinForms user-interface, with two buttons at the top that allows the user to toggle between two views.
So, when I click the 1st button ("Show User Profiles"), the three panels below should show the three different user profiles (with some content fetched from database), like so...
And when I click the 2nd button ("Show Chat History"), the three panels below should show the three different chat histories (with some content fetched from database), like so...
What is a good approach (either dynamic or static) to implement this kind of structure in C# / .Net? Is there a cleaner or at least more efficient way than my crude method below:
Layout three sets of controls for the three Profiles
Layout three sets of controls for the three Chat-Histories, overlapping on top of
the Profiles' controls.
Change visibility of the controls based on which button is pressed.
For example, if 1st button is clicked, Set Visibility=false for all the controls related to Chat-History, and Set Visibility=true for all the controls related to User-Profiles.
a tab control would give you a separate set of panels. Its the obvious way to do it, but if you want to overlay panels and control the visibility you can, and its fine. I have a content viewer that displays either images or text depending on the mime type of the content, and that context switching occurs without user interaction, so it makes sense there to put the image control on top of the textbox and set it visible if the mime type is image/jpeg. Where a user is going to make the choice tho, I would use a tab control.
I assume you are using the visual ui to add controls. you can just drag a tab control to your form and it should by default appear with 2 tabs defined. You can add more in properties my modifying the tabpages collection. That's where you would also rename them to reflect your choices (profiles, chats). drag the tab control up where you want it on the form and size it appropriately, or dock it to fill the form. drag 3 panels into the first tab, then click on the 2nd tab, and drag 3 more in there. then proceed as you would have. When the user clicks on the chat tab the tab control will manage the view - hiding the first tab and its 3 panels. Of course clicking the first tab would make that tabPage visible again. no need for you to code anything.
I'll just add that I don't understand the design of having 3 profiles visible, and 3 chat history's. Unless your users are going to be limited to 3 friends. I would think you would be better off using a listbox for friends names on the profiles page, with a single profile panel that just filled the profile controls based on which friend is selected, and then the same list on the chat page, with a single chat panel that loaded the history into the textbox based on which friend was selected. That way you can have all the friends you want :)
and for completeness i'll suggest one more way, why should the user have to switch between tabs to view a users profile or chat history when you can provide them both in a single tabPage? You could programmatically create a new tab for each user and on that tab have their profile panel on the left, and their chat history on the right. Less context switching = better user experience. The tab control will allow you to scroll for tabs that don't fit on the form automagically(tm).
I have a Silverlight view which has several layers of popups. It is a record search/edit page, which displays the results in a datagrid. There is a details view for each record that is then shown in a popup over the grid. Finally, the sections in the details view can be edited, and the edit form is displayed in a third popup. The search criteria is hidden when viewing data, but can be toggled into view.
The problem I am facing is that whenever the comboboxes on the edit popups are interacted with, it causes the layers below them to be un-clickable. In the screenshot I provided, if the user clicks on the Phone or Email comboboxes, even if they don't change the selections, and closes the topmost edit popup, then the delete, save, close, and view on map buttons no longer receive mouse interaction. They have mouseover styles that are not applied and they don't receive clicks. However, the New Group button does, but only below a certain point. It is behaving as if there is an invisible canvas/shape blocking mouse interaction.
Additionally, if the user slides out the Record Search panel (by clicking on the down arrow icon), the form somehow gets reset and those buttons are clickable again. Also, if the browser window gets resized the buttons are also clickable.
I've spent the better part of two days going through this, admittedly complicated, view and I'm positive there are no controls/canvases/shapes that I'm displaying that are being placed in the way, as I've added color/outlines to every canvas in the xaml.
At this point I am stumped and reconsidering redesigning the form to avoid this problem. Has anyone run into this and if so do you have a solution?