TabStrip placement and verticaltext

Posted on July 28, 2008. Filed under: Silverlight |

There are couple of ways to display Vertical text in TabItem

Here are 2 ways

1. Get the code for the VerticalTextblock from here and use it like this. I could not get the Binding to work but hard coding Text works

 <my:TabControl TabStripPlacement=”Left”>
             <my:TabItem Header=”Tab1″>
                <TextBlock Text=”Some Text in Tab1″ />
                 <my:TabItem.HeaderTemplate>
                    <DataTemplate>
                       <local:VerticalTextBlock Text=”Tab1″ />
                    </DataTemplate>
                </my:TabItem.HeaderTemplate>
            </my:TabItem>
            <my:TabItem Header=”tab2″>
                <TextBlock Text=”Some Text in Tab2″ />
                 <my:TabItem.HeaderTemplate>
                    <DataTemplate>
                      <local:VerticalTextBlock Text=”Tab2″ />
                    </DataTemplate>
                </my:TabItem.HeaderTemplate>
            </my:TabItem>
        </my:TabControl>

2. Use ItemsControl and set the ItemsSource to the Text we want to display

<my:TabControl TabStripPlacement=”Left”>
            <my:TabItem Header=”Tab1″>
                <TextBlock Text=”Some Text in Tab1″ />
                <my:TabItem.HeaderTemplate>
                    <DataTemplate>
                        <ItemsControl HorizontalAlignment=”Center”
                                      HorizontalContentAlignment=”Center”
                                      ItemsSource=”Tab1″></ItemsControl>
                    </DataTemplate>
                </my:TabItem.HeaderTemplate>
            </my:TabItem>
  </my:TabControl>

update:Added screenshot

Make a Comment

Make A Comment: ( None so far )

blockquote and a tags work here.

Liked it here?
Why not try sites on the blogroll...