tabitem

How can I loop through all of the controls in a tab control (wpf)?

I have seen a few examples of how to do this with winforms but have been unable to get it to work in wpf as a wpf TabItem does not have a definition for Controls. Here is the code that I'm using right now, which does not work. TabItem ti = rep1Tab; var controls = ti.Controls; foreach (var control in con...

Styling TabItem when populated with ItemsSource

Hi. I'm using a WPF Tabcontrol populated with a collection using Itemssource. <TabControl x:Name="_tabControl" ItemsSource="{Binding TabViewModelList}"> <TabControl.ItemContainerStyle> <Style TargetType="TabItem"> <Setter Property="Header" Value="{Binding TabCaption}"/> ...

Text orientation

Hi Guys I know you can do this to get vertical text in a tab header: <Window x:Class="Abodemploy.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <TabControl Margin="0" Name...

WPF TabItem Custom ContentTemplate

I have been strugging with this for a while, it would have been simple to do in WindowForms. I am making a IRC Client, there will be a number of Tabs one for each channel connect to. Each Tab needs to show a number of things, UserList, MessageHistory, Topic. In WindowForms i would just have inherited from TabItem, added some Custom Pro...

WPF - Overlapping Custom Tabs in a TabControl and ZIndex

Problem I have a custom tab control using Chrome-shaped tabs that binds to a ViewModel. Because of the shape, the edges overlap a bit. I have a function that sets the tabItem's ZIndex on TabControl_SelectionChanged which works fine for selecting tabs, and dragging/dropping tabs, however when I Add or Close a tab via a Relay Command I am ...

[WPF] Custom TabItem in TabControl

I've created CustomTabItem which inherits from TabItem and i'd like to use it while binding ObservableCollection in TabControl <TabControl ItemsSource="{Binding MyObservableCollection}"/> It should like this in XAML, but i do not know how change default type of the output item created by TabControl while binding. I've tried to creat...

How do I bind one TabControl to the TabItems of another TabControl in WPF?

I've defined the following TabControl called TabControl1: <TabControl> <TabItem Header="Cheese"> The Cheese Tab </TabItem> <TabItem Header="Pepperoni"> The Pepperoni Tab </TabItem> <TabItem Header="Mushrooms"> The Mushrooms Tab </TabItem> </TabControl> I've defined another TabControl, TabControl2 which is dynam...

Silverlight TabItem template not working correctly

Hello everybody! In a SL4 application i need to restyle my TabItems (actually add a button in the header). So i took the TabItem's control template from here and added the functionality i wanted. This seems to work fine, (i could dynamically add tabitems) with one exception: i think this posted control template is behaving somehow "...

How can I dynamically set the event handler for a TabItem when it is selected?

In XAML you can do <TabItem Selector.Selected="myEvenHandler"></TabItem> to set the event handler for when that tab is selected. How can I do the exact same thing dynamically. I would prefer not to use the SelectionChanged event of TabControl if I can help it. Clearly there is a Selected event on the TabItem I just cannot seem to g...

Silverlight TabControl - Finding and selecting a TabItem from a given Control in the TabItem.

I am building a LOB application that has a main section and a TabControl with various TabItems in it. On hitting save the idea is that any fields in error are highlighted and the first field in error gets the focus. If the first, and only, field in error is on an Unselected tab the tab should then become selected and the field in error ...

Silverlight Custom TabItem?

Hi all, I tried to create a custom tabitem on Silverlight, but when i run it, it's complaining Unable to cast CustomTab to TabItem. I am not sure how to fix that, any idea? Thanks alot ...

Keep TabItems in a TabControl from repositioning?

Hi everyone, In WPF, Is there a simple way to stop TabItems in a TabControl from being repositioned when the selected TabItem changes? So that clicking on a TabItem would simply display its contents, but not reposition the TabItems as it usually does (by moving the selected TabItem to the bottom row of tabs if it wasn't there already). ...

WPF TabControl & TabItems with DropShadows

Hi Guys, I'm looking for a way to control DropShadow (DS) effects on the TabControl and TabItems in Blend 3. I want a DS effect on the selected TabItem and TabControl and then a different DS effect on the unselected TabItems. There is an image here to show what I mean: http://www.funkadeelia.com/imageHosting/TabControl_example.jpg Ba...

Migrate style from TabItem to TabHeader

Good day! I have a TabControl with TabItems that have been customized via a control template. This control template specifies a trigger whereby on mouseover, the content of tab header grows slightly. <ControlTemplate> <Storyboard x:Key="TabHeaderGrow"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.Target...

Please critique this method

Hi I've been looking around the net for some tab button close functionality, but all those solutions had some complicated eventhandler, and i wanted to try and keep it simple, but I might have broken good code ethics doing so, so please review this method and tell me what is wrong. public void AddCloseItem(string header, object conte...

Tabitem.focus only focuses on tabitem header

Hey. I have a tabcontrol that is bound to an observable collection. I've tried doing var tabitem = (TabItem)this.SingleOrDefault(ti => ti.Name == tabname); tabitem.Focus(); ((UserControl)tabitem.Content).Focus(); And it does seem like it focuses on the tabitem, but only on a btn in the header of the tabitem, not on the conte...

How to make the selected TabItem look attached to the rest of the document

I have a WPF app with a few Tabs. I'm now messing around with styling and have for example changed the ControlTemplate so I now have to define everything about the TabItem. Now the TabItem that is selected seems detached from the document below because of some thin line around that content (there is no border). I'm not sure what techniq...

I want to use a silverlight TabItem as a button container

I want zero functionality and appearance. I also want it to be all the way to the right of the tab strip. does anyone have any pointers as to how I can accomplish this? ...

Setting TabItem foreground color also sets the TabControl foreground color

I have a TabControl that I have restyled. The TabItem has a trigger that is fired when the TabItem is selected that changes the TabItem text to bold and green. The problem I have is that the text in the contents of the tab is also set to bold and green. I can work around this by setting all of my controls in the tab content to be the co...

content of tabiem

i want to have xaml drawing brush icons in my tabitem, next to the text. how should the icons be switched from outside of the style itself? i know how to do it with images (with Tag) but not sure with drawing brushes. thanks ...