These are chat archives for AvaloniaUI/Avalonia

2nd
Aug 2018
Benedikt Schroeder
@Gillibald
Aug 02 2018 12:56
Is it intended that this style <Style Selector="TabControl.sidebar TabItem"> is applied to a TabControl's TabItem that has no sidebar class?
<TabControl Classes="sidebar">
    <TabItem Header="Tab A">
        <TabControl>    
            <TabItem Header="Tab in nested TabControl">
            </TabItem>
        </TabControl>
    </TabItem>
  </TabControl>
Benedikt Schroeder
@Gillibald
Aug 02 2018 13:01
<Style Selector="TabControl.sidebar TabItem:selected"> gets applied to the nested TabItem
Jeremy Koritzinsky
@jkoritzinsky
Aug 02 2018 14:19
Yep that's intended.
Benedikt Schroeder
@Gillibald
Aug 02 2018 14:37
But that makes TabControl.sidebar redundant or am I wrong? <Style Selector="TabControl TabItem"> would have the same result and that doesn't make much sense.
Benedikt Schroeder
@Gillibald
Aug 02 2018 14:40
Hmm so the style always had an issue I understand
Jeremy Koritzinsky
@jkoritzinsky
Aug 02 2018 15:05
The reason it was correct was because the TabItem was under a TabControl with the class sidebar. The fact that there was another TabControl in between those two on the Logical Tree doesn't matter with the selector your posted.
Benedikt Schroeder
@Gillibald
Aug 02 2018 15:54
Does it make sense to allow this:
<TabControl>
    <TextBlock/>
    <TextBlock/>
    <TextBlock/>
</TabControl>
Wiesław Šoltés
@wieslawsoltes
Aug 02 2018 16:04
2018-08-02_18-03-27.gif
@Gillibald Looks like in WPF it creates 3 tabs and textblock is content
devenv_2018-08-02_18-06-29.png
Benedikt Schroeder
@Gillibald
Aug 02 2018 16:09
Hmm so it makes sense to support IHeadered. Thanks for making this clear.
Wiesław Šoltés
@wieslawsoltes
Aug 02 2018 16:10
Not convinced how this make it useful, how do you set TabItem Header text ?
Benedikt Schroeder
@Gillibald
Aug 02 2018 16:17
The normal case is that the DataContext is bound to the Header if no Header is set but if you use a Control we can't do that. So only controls that implement IHeadered are supported in that case.
Benedikt Schroeder
@Gillibald
Aug 02 2018 18:04
Looks like the new TabControl will be quiet advanced there are probably too much posibilities to customize things :)
Wiesław Šoltés
@wieslawsoltes
Aug 02 2018 18:41
Thanks a good thing I suppose :smile:
Anyway good to have working TabControl
Do you have any customisation samples?
Benedikt Schroeder
@Gillibald
Aug 02 2018 20:41
That will take some time. Have to fix some weird bug in the ControlCatalog after changing tabs in a nested TabControl the content disappears only changing the tab on the main TabControl brings everything back. Next week I am on vacation so it will take some time before I can finish everything. There is still stuff left to do. I am open for suggestions what can be improved. In general everything should work like the WPF version.
Wiesław Šoltés
@wieslawsoltes
Aug 02 2018 21:23
Ok no problem