Navigate between GridViews with keyboard arrows in Windows 8 App - c#

I have app layout with several GridViews, now the navigation between GridViews is done using TAB key, and you navigate inside each GridViews with arrows. What I would like to do, is: when I'm on the marginal element of one GridView, to press an arrow key to go to other GridView.

This is 100% possible, but requires 100% code. And if your grid item quantity is dynamic then the logic is that much more complex. But to your point, I know of apps that do this. Every one of them rolled their own solution to detect keyboard arrows and calc based on selected item in the grid.
It's why we are developers, right? Solving problems with code!
Best of luck!

Related

Simulating page transition animation when showing a Grid in UWP

I have a Windows 10 (UWP) app with a few screens in a SplitView. When navigating among pages a page transition animation is shown (I added animations to the SplitView's Frame).
One page of the app is a bit different. In the left half a calendar is shown. In the right half a detail for a day is shown. When a user taps a day in the calendar (on the left), the detail is shown on the right.
When the windows is narrow or the app runs on a phone, only the calendar or the day are shown. So the users sees the calendar, taps on a day and the calendar hides (Visibility=Collapsed) and the day detail shows (Visibility=Visible). And vice versa on back key press.
The problem is that this feels awkward, because there is no animation that would look like transitioning from calendar to day.
So the question is, how to simulate a page transition animation when showing a Grid?
I took a look at the UWP sample for a master-detail scenario (my situation is basically a master-detail scenario). In the sample Microsoft has two pages instead of on, a master page with a list and a detail and a separate, duplicated, detail page. And a ton of ugly code behind for navigating depending on screen size, manipulation the back stack when windows size changes and so on. Not really an elegant solution.
Not sure about an elegant solution to simulate a navigation transition, but I wouldn't use Visibility. It doesn't play well with animations.
I'd consider using something like a Transform animation to offset the two element by one screen width. I won't simulate a navigation transition, but it'll be better than a jarring switch.
Alternatively you could simulate something like the Pivot transition when it changes tabs.

How to enable dragging objects between Grids (without using ListView or GridView)?

I've written a Windows Store-type app where you drag Player objects back and forth between two Grids (onField and Sideline). Worked great, but you could only move by (1) tap Player (2) tap target position. Then I decided I wanted to also let the user drag Players. I tried adding a thumb to the Players ... considered and rejected the possibility of using a Canvas.
All signs pointed to ListView or Gridview solutions, so I tried changing the onField and Sideline Grids to GridViews, but couldn't see any way to get the layout+sizing I wanted for the positions. Finally, I put a Gridview in each cell of the big layout grids. This worked, but at a cost of latency in moving Players between positions as well as lag in certain sorting operations. Also, the drag operations only work if the initial drag direction is downward (???).
TLDR: GridView and ListView solutions seem sub-par for my grid-to-grid drag-and-drop needs.
In the WinRT xaml framework only GridView and ListView support drag and drop operations. I have no idea why but that's just the case.
This doesn't stop you creating your own but you really have to start from scratch which is a pain in the ass since you can't make use of the AllowDrop property etc.
You may have some luck porting the Silverlight Drag and Drop library to WinRT but it's not something I've tried.

Switching controls based on Combo Box Value

I am looking into developing a GUI that will switch the controls based on the value of the selected combo box item.
I have tried adding a different canvas or grid to the gui designer in visual studio but it comes hard to manage as everything overlaps each other in the designer and is hard to know what's what.
Is there an easy way that I can do this, is there a particular control that makes this easy to achieve. I don't really want code the gui in c# and not use xaml.
What I was hoping to do is that all the controls are in there own panel and when the combo box value is changed one panel is removed or hidden and the other is shown.
How can something like this be achieved.
Thanks for any help you can provide
You could implement each different "mode" as a separate UserControl.
Then have a shell with the combobox, where the combobox OnChange will swap out what UserControl is plugged into the shell.
Any other totally common components such as OK/cancel buttons could be part of the shell.
A completely alternative implementation to consider is a tabbed approach, but that probably only flies if it makes sense for the user to act on several of them.
What will you do if the user selects A in the combo, makes changes in UserControlForA, and then selects B in the combo? Could be an annoying corner case, and if this is production code the sort of thing that you'll get future user requests to change how it works.
If you're sure of the design go for it. If not, I'd play around with a few apps and try to find a nice example of the same sort of thing, and consider how they approached it.
But techwise I think a UserControl is what you're describing.
(Edit: crud just saw the xaml/wpf in the question, not sure this is correct in that context, clueless there)
You can use DataTemplate for each different mode.See Different item template for each item in a WPF List for more information.

Have buttons overflow onto a second toolbar

I'm looking to have a Windows Forms toolbar overflow its buttons onto a second toolbar another level down rather than having the dropdown menu. We find that it is not obvious to our users that they need to click the dropdown to see more tools. Suggestions?
Break your toolbar up into several smaller toolbars, like how MS Office does it. This way you can arrange them on as many rows as you like.
If breaking this into multiple toolbars will not provide the user experience that you want (although it is clearly the best practice), I believe you can listen to the Resize event, and then move all items from the Items collection that have IsOnOverflow set to true to a second tool strip.

How to break a context menu into more than one column in Winforms?

I have a ContextMenuStip that contains a dynamically generated list of ToolStripMenuItem objects. The problem is that when there are too many of them to fit onto the screen, tiny scroll buttons appear at the top and at the bottom of the list, and scrolling through the list is a bit tedious.
How can I make the menu to automatically break into 2 or more columns so the user does not have to scroll?
This behaviour was dropped from Windows some while ago -note that Windows Vista/7 use a tree to show programs in the start menu. I suspect that this was because it presents too much data and decision making for the user.
Are you sure that this is the best way to present the choices to the user?
If so, then you will probably need a custom menu control which will be quite a lot of work.
If not, then you should consider how
you can achieve the same choices with
other controls. How about a list with
a filter?
Is there some natural grouping to the
items? If so you could split into
listboxes, comboboxes or trees.
Does the application need splitting
into different modes?
Are the items numbers? - if so a
numeric up/down control might work
The general approach is to simplify the amount of decision making that the user has to make at any moment.
Spend some time playing with all the controls in the WinForms toolbox to see what works well.

Categories