tabcontrol

Silverlight: Adding TabItems to TabControl dynamically with a standard ContentTemplate for all tabs

I would like to add TabItems to a TabControl dynamically with a standard ContentTemplate comprising of a grid and few other input controls like textbox and button. Can someone pls help me achieve this? Also, if I try to load data from a WCF service asynchronously to the grid, there will definitely be a time lag. So how do I exactly bind...

WPF: Get Tabtitle from Content (in template)

Hi Guys, I'm trying to display the Title of an Tabitem in his contentpresenter. Is there a possibility to get this name? For example in the Tabcontrol Template something like <Label> <ContentPresenter ContentSource="SelectedContentHeader" Grid.Row="1" /> </Label> to display the name of the current tab in label. Thanks in advanc...

Silverlight TextBox.TextChanged event when tab item is unfocused

It's easy to test that TextChanged event won't fire when a text box is inside inactive tab item of a tab control. The same is true when text box is invisible (but unselecting tab item doesn't set text box's Visibility property to Collapsed). I guess the problem is not specific to text box or TextChanged event. What I need is to force Tex...

Steal/borrow Visual Studio 2010 tabcontrol-template?

I want/would like a TabControl with TabItem's I can close (with an x) and move around. If I also could move the tabitems to other screens it would be great. In fact I want it exactly as in VS2010 with docking and splitting side-by-side etc. But to implement all this by my self would take weeks. Thats life I suppose, but perhaps there is ...

WPF - Weird scrollbars behavior in TabItem

I have following code: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="145" Width="156"> <Window.Resources> <DataTemplate x:Key="tabTemplate"> <ScrollViewer> <StackPanel Orie...

How to change the order of the TabItem in the wpf TabControl

I need to change the order of the TabItem. I've tried with Remove / Insert and it doesn't works. void UserControl_Loaded(object sender, RoutedEventArgs e) { if(condition) { TabControl.Items.Remove(TabItem); TabControl.Items.Insert(0, TabItem); } } InvalidOperationException: Element already has a logical parent. It mus...

Can I have multiple instances of the same UserControl in 1 app?

I am creating a Text Editor Type app. I can have multiple editors open via tabs. In my first try, I used simple TextBoxes to edit text. Everything worked ok. Then I created a UserControl encapsulating the text box + buttons to perform text manipulation eg. bold/italic etc. I found out that when I open different tabs, they all contain the...

How can I get a TabPage from a TabControl based on a Point?

Surely this has got to be easy; I'm just not having any luck with it. How would I get the TabPage of a given TabControl whose tab contains a given Point? For example, if I'm handling the MouseUp event and I want to know which tab the mouse was over when it was released. I tried GetChildAtPoint, but that seems to always return the first...

How to access new visual tree when WPF TabControl SelectedItem changes

Considering an already loaded and rendered TabControl with three tabs, with selected tab being index 1 (the middle one): Tab 1: Has one TextBox Tab 2: Has two TextBoxes Tab 3: Has three TextBoxes If I iterate through the selectedItem's visual tree with VisualTreeHelper, I will get Two textBoxes within the TabControl's children. I wa...

WPF: TabControl & DataTemplates

I just want to understand the following scenario. Where I am implementing a <TabControl> bound to a ObservableCollection<TabViewModel> No Data Templates When I don't have any DataTemplates, the text WpfApplication1.TabViewModel appears in the Tab Header and Content. Ok I understand this part. Just ItemTemplate When I just have <Ta...