WindowsCommunityToolkit icon indicating copy to clipboard operation
WindowsCommunityToolkit copied to clipboard

Tab control

Open hermitdave opened this issue 10 years ago • 135 comments

We need a control similar to Tab control. iOS has UISegmentedControl as shown below sementedcontrol

The control should expose the following properties UseTabSeparator : determins whether Tab Items are visually separated or not SeparatorWidth : the distance between 2 tabs in pixels Items: User supplied list of TabItem SelectedIndex: Gets or set index position of currently selected TabItem (default 0) SelectedItem: Gets the item currently selected, zeroth item by default.

Based on above I have done some preliminary work and create Tab and TabItem controls. TabItem derives from ToggleButton and exposes all ToggleButton properties.

screenshot 50

UserVoice: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/17983933-tab-control-like-in-microsoft-edge

hermitdave avatar Sep 20 '16 09:09 hermitdave

I would like thoughts on whether its worth pursuing and what behaviours are expected out of a Tab control

hermitdave avatar Sep 20 '16 09:09 hermitdave

The tab control is a tough one (in my mind) given that the pivot control can be used as tab control now (albeit only if the header items don't take up more space than is available). I wonder whether the tab control should maybe extend the pivot? if we can find a way to force tab mode in pivot, then that would be ideal.

ScottIsAFool avatar Sep 20 '16 10:09 ScottIsAFool

Pivot also has content area and there's a very specific transition behaviour while looked great in WP7 is dated and not always wanted.

I'd personally stay clear of Pivot just for that reason

hermitdave avatar Sep 20 '16 11:09 hermitdave

I disagree with that. Even built in apps in Win10 are still using tabs with transitions. Just look at Alarms & Clocks. That doesn't look out of place or "dated". Plus those transitions are enabled via storyboards in the template, they can be removed if we really didn't want it.

ScottIsAFool avatar Sep 20 '16 11:09 ScottIsAFool

One thing that Windows 8 taught many was that just because a stock templates and often stock apps do that doesn't mean it has to be done everywhere..

And most stock apps use Hamburger.. maybe we should just suggest that to everyone

hermitdave avatar Sep 20 '16 11:09 hermitdave

Ignore Windows 8, that was just... well, everything about it was wrong. I don't believe it should be us that makes the tab control behave differently from stock controls, but we should build it so other devs can do if they want.

ScottIsAFool avatar Sep 20 '16 11:09 ScottIsAFool

I am talking to Islandwood team and they have an equivalent of UISegmentedControl so maybe iOS ported apps will have one design and rest will have different ?

hermitdave avatar Sep 20 '16 11:09 hermitdave

Unless you're suggesting incorporating the Islandwood control into this toolkit, I'm not really sure what your point is with that.

ScottIsAFool avatar Sep 20 '16 11:09 ScottIsAFool

We should have equivalent control and one that can be identically templated.

hermitdave avatar Sep 20 '16 11:09 hermitdave

I've not said we shouldn't...

ScottIsAFool avatar Sep 20 '16 11:09 ScottIsAFool

I am trying to get to the bottom on islandwood control behaviour but I doubt they went about templating pivot

hermitdave avatar Sep 20 '16 11:09 hermitdave

Isn't all their stuff on github anyway?

ScottIsAFool avatar Sep 20 '16 11:09 ScottIsAFool

@hermitdave has a valid point. to me this control is a list of buttons. The pivot has a client area that we do not want here (do we?)

deltakosh avatar Sep 20 '16 15:09 deltakosh

@deltakosh then what would be happening when you select one of those tabs?

ScottIsAFool avatar Sep 20 '16 16:09 ScottIsAFool

Like on iOS, you receive an event and you do what you want with it

deltakosh avatar Sep 20 '16 16:09 deltakosh

Fair enough. Pivot doesn't have to have content though, right? If we subclassed pivot and changed the template to not include content, would that work? Im just thinking we could borrow a lot from pivot.

ScottIsAFool avatar Sep 20 '16 16:09 ScottIsAFool

This is worth a try I would say

deltakosh avatar Sep 20 '16 16:09 deltakosh

I'm happy to be shown that Pivot and PivotItem are better suited. ToggleButton has both events and properties that PivotItem doesn't

hermitdave avatar Sep 20 '16 16:09 hermitdave

(I'm not convinced as well but it is worth trying)

deltakosh avatar Sep 20 '16 16:09 deltakosh

What properties and events do you need?

ScottIsAFool avatar Sep 20 '16 16:09 ScottIsAFool