Click here to Skip to main content
15,887,585 members
Home / Discussions / WPF
   

WPF

 
Questionmulti Master-Detail view Pin
daniel radford18-May-09 2:42
daniel radford18-May-09 2:42 
AnswerRe: multi Master-Detail view Pin
Mark Salsbery18-May-09 5:40
Mark Salsbery18-May-09 5:40 
GeneralRe: multi Master-Detail view Pin
daniel radford19-May-09 6:39
daniel radford19-May-09 6:39 
GeneralRe: multi Master-Detail view Pin
Mark Salsbery19-May-09 6:57
Mark Salsbery19-May-09 6:57 
GeneralRe: multi Master-Detail view Pin
daniel radford20-May-09 0:47
daniel radford20-May-09 0:47 
QuestionHelp Require: Huge DataBinding makes the Application Hang!!! Pin
Kunal Chowdhury «IN»17-May-09 20:57
professionalKunal Chowdhury «IN»17-May-09 20:57 
AnswerRe: Help Require: Huge DataBinding makes the Application Hang!!! Pin
Insincere Dave18-May-09 13:42
Insincere Dave18-May-09 13:42 
QuestionTabItem Border [SOLVED] Pin
#realJSOP15-May-09 6:11
mve#realJSOP15-May-09 6:11 
When a tab is selected, I get a line (the border of the tab control) under the tab. I want to get rid of the line between the tab content and the tabitem. This probably has something to do with the templates I'm using, but I'm not sure what I can do to address the issue. I looked around to see if you could set the color for a border on a side-by-side basis, but it doesn't look like you can. Can anyone help?

Here is my resource dictionary xaml file (in it's entirety - big text alert):

<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mscorlib="clr-namespace:System;assembly=mscorlib"    
    >

    <Style x:Key="StyleUDPBaseRepeatButton" TargetType="{x:Type RepeatButton}" >
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Opacity" Value="0.40" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="StyleTabControlRepeatButton" TargetType="{x:Type RepeatButton}" BasedOn="{StaticResource StyleUDPBaseRepeatButton}" >
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border CornerRadius="13" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ======================================================================================================== -->
    <!-- Scroller buttons for scrolling tabs -->
    <Style x:Key="StyleButtonTabScrollRepeatPrev" TargetType="{x:Type RepeatButton}" BasedOn="{StaticResource StyleTabControlRepeatButton}" >
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Image Source="/CometResources;component/Images/GlassPrevTab64.png" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="StyleButtonTabScrollRepeatNext" TargetType="{x:Type RepeatButton}" BasedOn="{StaticResource StyleTabControlRepeatButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Image Source="/CometResources;component/Images/GlassNextTab64.png" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- TabItem with rounded corners -->
    <ControlTemplate TargetType="TabItem" x:Key="UDPTabItem">
        <Grid SnapsToDevicePixels="True">
            <Border BorderThickness="1,1,1,0" 
                    Padding="{TemplateBinding Control.Padding}" 
                    BorderBrush="{TemplateBinding Border.BorderBrush}" 
                    Background="{TemplateBinding Panel.Background}" 
                    Name="Bd" 
                    CornerRadius="4,4,0,0" >
                <ContentPresenter RecognizesAccessKey="True" 
                                  Content="{TemplateBinding HeaderedContentControl.Header}" 
                                  ContentTemplate="{TemplateBinding HeaderedContentControl.HeaderTemplate}" 
                                  ContentStringFormat="{TemplateBinding HeaderedContentControl.HeaderStringFormat}" 
                                  ContentSource="Header" 
                                  Name="Content" 
                                  HorizontalAlignment="Stretch" 
                                  VerticalAlignment="Stretch" 
                                  SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
            </Border>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="UIElement.IsMouseOver">
                <Setter Property="Panel.Background" TargetName="Bd">
                    <Setter.Value>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                            <LinearGradientBrush.GradientStops>
                                <GradientStop Color="#FFEAF6FD" Offset="0.15" />
                                <GradientStop Color="#FFD9F0FC" Offset="0.5" />
                                <GradientStop Color="#FFBEE6FD" Offset="0.5" />
                                <GradientStop Color="#FFA7D9F5" Offset="1" />
                            </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Trigger.Value>
                    <mscorlib:Boolean>True</mscorlib:Boolean>
                </Trigger.Value>
            </Trigger>
            <Trigger Property="Selector.IsSelected">
                <Setter Property="Panel.ZIndex">
                    <Setter.Value>
                        <mscorlib:Int32>1</mscorlib:Int32>
                    </Setter.Value>
                </Setter>
                <Setter Property="Panel.Background" TargetName="Bd">
                    <Setter.Value>
                        <SolidColorBrush>#FFF9F9F9</SolidColorBrush>
                    </Setter.Value>
                </Setter>
                <Trigger.Value>
                    <mscorlib:Boolean>True</mscorlib:Boolean>
                </Trigger.Value>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="Selector.IsSelected">
                        <Condition.Value>
                            <mscorlib:Boolean>False</mscorlib:Boolean>
                        </Condition.Value>
                    </Condition>
                    <Condition Property="UIElement.IsMouseOver">
                        <Condition.Value>
                            <mscorlib:Boolean>True</mscorlib:Boolean>
                        </Condition.Value>
                    </Condition>
                </MultiTrigger.Conditions>
                <Setter Property="Border.BorderBrush" TargetName="Bd">
                    <Setter.Value>
                        <SolidColorBrush>#FF3C7FB1</SolidColorBrush>
                    </Setter.Value>
                </Setter>
            </MultiTrigger>
            <Trigger Property="TabItem.TabStripPlacement">
                <Setter Property="Border.BorderThickness" TargetName="Bd">
                    <Setter.Value>
                        <Thickness>1,0,1,1</Thickness>
                    </Setter.Value>
                </Setter>
                <Trigger.Value>
                    <x:Static Member="Dock.Bottom" />
                </Trigger.Value>
            </Trigger>
            <Trigger Property="TabItem.TabStripPlacement">
                <Setter Property="Border.BorderThickness" TargetName="Bd">
                    <Setter.Value>
                        <Thickness>1,1,0,1</Thickness>
                    </Setter.Value>
                </Setter>
                <Trigger.Value>
                    <x:Static Member="Dock.Left" />
                </Trigger.Value>
            </Trigger>
            <Trigger Property="TabItem.TabStripPlacement">
                <Setter Property="Border.BorderThickness" TargetName="Bd">
                    <Setter.Value>
                        <Thickness>0,1,1,1</Thickness>
                    </Setter.Value>
                </Setter>
                <Trigger.Value>
                    <x:Static Member="Dock.Right" />
                </Trigger.Value>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="Selector.IsSelected">
                        <Condition.Value>
                            <mscorlib:Boolean>True</mscorlib:Boolean>
                        </Condition.Value>
                    </Condition>
                    <Condition Property="TabItem.TabStripPlacement" Value="{x:Static Dock.Top}" />
                </MultiTrigger.Conditions>
                <Setter Property="FrameworkElement.Margin">
                    <Setter.Value>
                        <Thickness>-2,-2,-2,-1</Thickness>
                    </Setter.Value>
                </Setter>
                <Setter Property="FrameworkElement.Margin" TargetName="Content">
                    <Setter.Value>
                        <Thickness>0,0,0,1</Thickness>
                    </Setter.Value>
                </Setter>
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="Selector.IsSelected">
                        <Condition.Value>
                            <mscorlib:Boolean>True</mscorlib:Boolean>
                        </Condition.Value>
                    </Condition>
                    <Condition Property="TabItem.TabStripPlacement" Value="{x:Static Dock.Bottom}" />
                </MultiTrigger.Conditions>
                <Setter Property="FrameworkElement.Margin">
                    <Setter.Value>
                        <Thickness>-2,-1,-2,-2</Thickness>
                    </Setter.Value>
                </Setter>
                <Setter Property="FrameworkElement.Margin" TargetName="Content">
                    <Setter.Value>
                        <Thickness>0,1,0,0</Thickness>
                    </Setter.Value>
                </Setter>
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="Selector.IsSelected">
                        <Condition.Value>
                            <mscorlib:Boolean>True</mscorlib:Boolean>
                        </Condition.Value>
                    </Condition>
                    <Condition Property="TabItem.TabStripPlacement" Value="{x:Static Dock.Left}" />
                </MultiTrigger.Conditions>
                <Setter Property="FrameworkElement.Margin">
                    <Setter.Value>
                        <Thickness>-2,-2,-1,-2</Thickness>
                    </Setter.Value>
                </Setter>
                <Setter Property="FrameworkElement.Margin" TargetName="Content">
                    <Setter.Value>
                        <Thickness>0,0,1,0</Thickness>
                    </Setter.Value>
                </Setter>
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="Selector.IsSelected">
                        <Condition.Value>
                            <mscorlib:Boolean>True</mscorlib:Boolean>
                        </Condition.Value>
                    </Condition>
                    <Condition Property="TabItem.TabStripPlacement" Value="{x:Static Dock.Right}" />
                </MultiTrigger.Conditions>
                <Setter Property="FrameworkElement.Margin">
                    <Setter.Value>
                        <Thickness>-1,-2,-2,-2</Thickness>
                    </Setter.Value>
                </Setter>
                <Setter Property="FrameworkElement.Margin" TargetName="Content">
                    <Setter.Value>
                        <Thickness>1,0,0,0</Thickness>
                    </Setter.Value>
                </Setter>
            </MultiTrigger>
            <Trigger Property="UIElement.IsEnabled">
                <Setter Property="Panel.Background" TargetName="Bd">
                    <Setter.Value>
                        <SolidColorBrush>#FFF4F4F4</SolidColorBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="Border.BorderBrush" TargetName="Bd">
                    <Setter.Value>
                        <SolidColorBrush>#FFC9C7BA</SolidColorBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="TextElement.Foreground">
                    <Setter.Value>
                        <DynamicResource ResourceKey="{x:Static SystemColors.GrayTextBrushKey}" />
                    </Setter.Value>
                </Setter>
                <Trigger.Value>
                    <mscorlib:Boolean>False</mscorlib:Boolean>
                </Trigger.Value>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>


    <!-- Account Manager WINDOW tab control -->
    <ControlTemplate x:Key="UDPTemplateTabControl" TargetType="{x:Type TabControl}">
        <Grid x:Name="Grid" KeyboardNavigation.TabNavigation="Local">
            <Grid.ColumnDefinitions>
                <ColumnDefinition x:Name="ColumnDefinition0"/>
                <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition x:Name="RowDefinition0" Height="Auto"/>
                <RowDefinition x:Name="RowDefinition1" Height="*"/>
            </Grid.RowDefinitions>
            <Border Grid.Row="1" 
                    Grid.Column="0" 
                    x:Name="ContentPanel" 
                    BorderBrush="{TemplateBinding BorderBrush}" 
                    BorderThickness="{TemplateBinding BorderThickness}" 
                    KeyboardNavigation.TabIndex="2" 
                    KeyboardNavigation.TabNavigation="Local" 
                    KeyboardNavigation.DirectionalNavigation="Contained" 
                    Background="{TemplateBinding Background}" 
                    CornerRadius="6,6,6,6">
                <ContentPresenter DataContext="{x:Null}" Margin="{TemplateBinding Padding}" 
                                          x:Name="PART_SelectedContentHost" 
                                          Content="{TemplateBinding SelectedContent}" 
                                          ContentTemplate="{TemplateBinding SelectedContentTemplate}" 
                                          ContentTemplateSelector="{TemplateBinding SelectedContentTemplateSelector}" 
                                          ContentSource="SelectedContent"/>
            </Border>
            <ScrollViewer x:Name="HeaderPanel" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Disabled">
                <ScrollViewer.Style>
                    <Style TargetType="{x:Type ScrollViewer}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate>
                                    <!--<Grid Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" x:Name="HeaderPanel">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="23"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="23"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="23" MinHeight="23" />
                                        </Grid.RowDefinitions>
                                        <RepeatButton x:Name="accountPrevTab" 
                                                      Grid.Column="0" 
                                                      Command="ScrollBar.LineLeftCommand" 
                                                      Style="{DynamicResource StyleButtonTabScrollRepeatPrev}" />
                                        <ScrollContentPresenter Grid.Column="1" Content="{TemplateBinding ScrollViewer.Content}" />
                                        <RepeatButton x:Name="accountNextTab" Grid.Column="2" Command="ScrollBar.LineRightCommand" Style="{DynamicResource StyleButtonTabScrollRepeatNext}"/>
                                    </Grid>-->
                                    <Grid Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" x:Name="HeaderPanel">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="23"/>
                                            <ColumnDefinition Width="5" />
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="5" />
                                            <ColumnDefinition Width="23"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="23" MinHeight="23" />
                                        </Grid.RowDefinitions>
                                        <RepeatButton x:Name="accountPrevTab" 
                                                      Grid.Column="0" 
                                                      Command="ScrollBar.LineLeftCommand" 
                                                      Style="{StaticResource StyleButtonTabScrollRepeatPrev}" />
                                        <Grid Grid.Column="1" />
                                        <ScrollContentPresenter Grid.Column="2" Content="{TemplateBinding ScrollViewer.Content}" />
                                        <Grid Grid.Column="3" />
                                        <RepeatButton x:Name="accountNextTab" 
                                                      Grid.Column="4" 
                                                      Command="ScrollBar.LineRightCommand" 
                                                      Style="{StaticResource StyleButtonTabScrollRepeatNext}"/>
                                    </Grid>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </ScrollViewer.Style>
                <StackPanel IsItemsHost="true" Orientation="Horizontal" Background="{x:Null}" KeyboardNavigation.TabIndex="1" />
            </ScrollViewer>
        </Grid>
    </ControlTemplate>

</ResourceDictionary>



"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


modified on Tuesday, May 19, 2009 4:55 PM

AnswerRe: TabItem Border Pin
#realJSOP18-May-09 1:03
mve#realJSOP18-May-09 1:03 
AnswerRe: TabItem Border Pin
Pete O'Hanlon18-May-09 1:56
mvePete O'Hanlon18-May-09 1:56 
GeneralRe: TabItem Border Pin
#realJSOP18-May-09 9:02
mve#realJSOP18-May-09 9:02 
GeneralRe: TabItem Border Pin
#realJSOP19-May-09 9:57
mve#realJSOP19-May-09 9:57 
QuestionListen to the event when the border of one UI element crosses the border of the other UI element Pin
YouMiss15-May-09 5:09
YouMiss15-May-09 5:09 
AnswerRe: Listen to the event when the border of one UI element crosses the border of the other UI element Pin
Mark Salsbery15-May-09 6:44
Mark Salsbery15-May-09 6:44 
GeneralRe: Listen to the event when the border of one UI element crosses the border of the other UI element Pin
YouMiss16-May-09 7:45
YouMiss16-May-09 7:45 
GeneralRe: Listen to the event when the border of one UI element crosses the border of the other UI element Pin
Mark Salsbery16-May-09 7:51
Mark Salsbery16-May-09 7:51 
GeneralRe: Listen to the event when the border of one UI element crosses the border of the other UI element Pin
YouMiss16-May-09 8:38
YouMiss16-May-09 8:38 
QuestionWPF 3-D Points Plotting Pin
Member 124748115-May-09 3:24
Member 124748115-May-09 3:24 
AnswerRe: WPF 3-D Points Plotting Pin
Niladri_Biswas17-Jun-09 21:16
Niladri_Biswas17-Jun-09 21:16 
QuestionWPF DataGrid Pin
Baktha Singh Dharmaraj15-May-09 0:11
Baktha Singh Dharmaraj15-May-09 0:11 
AnswerRe: WPF DataGrid Pin
Mark Salsbery15-May-09 6:46
Mark Salsbery15-May-09 6:46 
AnswerRe: WPF DataGrid Pin
Niladri_Biswas13-Jun-09 3:37
Niladri_Biswas13-Jun-09 3:37 
QuestionRich WPF Charts Pin
Jacobus0114-May-09 21:27
Jacobus0114-May-09 21:27 
AnswerRe: Rich WPF Charts Pin
Member 124748119-May-09 8:02
Member 124748119-May-09 8:02 
QuestionWritableBitmap in silverlight3 Pin
VCsamir14-May-09 20:07
VCsamir14-May-09 20:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.