I am new in caliburn microframework and MVVM itself in WPF. I am looking for way how to achieve activating multiple user control in one page, dependent on user selection.
As you can see in the picture below, when user clicks on the new file the window "Select calculation" will appear and in the checkboxes user can select calculation according some standards like DIN, CSN etc.
After confirmation with OK button, in the "Input parameters screen part" then appear User controls which will contain textboxes for input parameters.
Problem is that every standard has slightly different parameters for calculation. So my goal is to open only user control with input parameters textboxes and labels which are corresponding with selected standard.
So my question is: How to achieve this activating of multiple user controls in one screen part? If I use conductor I can activate only one item in time.
I thought about approach that I will load all input parameters user controls and make visible only these which corresponding with standards that user selected.
Image representing layout of application
Related
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 am coding a Windows phone application. In one of my pages, I have a list picker which is populated from the database, therefore its size depends on how many records there are in the database.
My main issue is that if there are records more than a certain amount, the "extra records" are displayed behind the next control in the page and cannot be accessed.
How can I give the list picker precedence over other controls such that it is displayed in front? To give you an idea of what I want, imagine having multiple pictures in Microsoft Word and setting one picture as 'Bring to Front'.
As you can see, the entry "tommy_shaw" is greyed out. This is because it is overlapping the Transaction ID textbox. Attempting to click on "tommy_shaw" would only load up the keyboard to enter text in the Transaction ID textbox.
I believe you can fix it with grouping; which ever one you have in the code first will be displayed first. If you have two images grouped together, then it is going to try and display both of them at the sametime.
I solved it using Canvas.zIndex = 1 in the xaml file
I'm working on an app which encodes text to QR codes.
Currently I have a form which does this for a single string.
(source: fotopocket.nl)
At the top I've added a View menu item with two subitems:
Single (which is what we're looking at now)
Bulk (which would allow a user to select an import file)
When the user selects Bulk I want to have a different toolstrip and input fields (but the same menu).
Should I create another form for this with the same dimensions (and menu) and switch the forms when another view is selected.
Or should I code both views in the same form somehow?
Basically I don't want to let the user notice a complete new screen is loaded.
So if I would have to go the 2 forms route I need to make sure the forms will be placed at the same position.
What would be the correct way to get this functionality?
I would suggest creating a UserControl for the content (toolstrip and input fields) for Single and another UserControl for the content (toolstrip and input fields) for Bulk. You could add both to your single form and then show the correct one based on which menu option is selected.
This would give you some of the benefit of having two forms - your event handlers and such would be separated into each UserControl, but you would be loading the content into one user-visible form.
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?
I am adding layout management to my winforms GUI which really just means that you can "Save" the current column settings with a "Key"
so for example you can have "View 1" or "View 2".
anyway, i dont have much real estate on the screen but i am trying to figure out the best way to:
Allow you to save the current layout as a "Saved Layout"
Allow you to select another layout and apply it.
Right now i have:
Save Icon
Combobox that has a list of saved layouts
Apply Icon
It works ok but it look a little unclear because the dropdown combobox is available and doesn't necessarly correspond to the view you are looking at.
I thought one idea was to instead of showing the combo, to just have two buttons:
Save layout
Apply existing layout.
when you clicked #2, this would then turn into a dropdown and show the other layouts.
thoughts or any other suggestions on a clear way to visualize this?
When space is tight, I'm a big fan of the LinkLabel and the ContextMenuStrip controls.
Save would pop up another form or something for entering the name of the current layout (or this could be set automatically), and Load displays the saved layouts in a popup menu that can then be clicked to select the desired layout.
LinkLabels take up less room than Buttons and ComboBoxes, and there's never any confusion about how they work.
I like your second idea, with one button to save and one generating a dropdown + apply
from my experience it's sometimes better to separate such logic into own modal window to select what to do and near your layout would be an icon suggesting for "advanced usage"
always try to "comment around" the components (use hints as much as possible) to tell the user what can be done with specific functionality
alt text http://www.talkingtext.com/wordpress_en/wp-content/uploads/2008/04/googleproduct.jpg
I try to keep the UI as uncluttered as I can, particularly when it comes to functionality that is of a more ancillary nature. To that end, if I can utilize something like a context menu that the user can right-click to pull up, I will. From the context menu, I generally provide a dialog box to support the functionality needed.
If the saving of the layout is a primary function of the form you are displaying to the user, it might warrant UI elements like a button or combo box that has dedicated real estate. Otherwise, I'd think seriously about putting the controls that provide that functionality on another pop-up dialog and using a mechanism like a context menu to bring up that dialog.
The downside to the context menu idea, initially, is that the user needs to "know" that the functionality exists. That might be solved by training or by tooltip hints or other means. Typically once the user "knows" that controls like ListViews, TreeViews and DataGridViews can have context menus, they don't have problems finding the functionality.
Just my two cents.