[WPF] TabControl Bug?

WPF์—์„œ Code Behind๋ฅผ ์‚ฌ์šฉํ•ด์„œ TabItem์„ ์ถ”๊ฐ€ํ–ˆ๋‹ค๊ฐ€ Clear ํ–ˆ๋‹ค๊ฐ€ ํ•˜๊ณ  ์žˆ๋Š”๋ฐ ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.TabControl', AncestorLevel='1''. BindingExpression:Path=TabStripPlacement; DataItem=null; target element is 'TabItem' (Name=''); target property is 'NoTarget' (type 'Object')

๊ทธ๋ž˜์„œ ๊ตฌ๊ธ€๋ง์„ ํ•ด๋ณด๋‹ˆ ์•„๋ž˜์™€ ๊ฐ™์€ ํ•ด๊ฒฐ๋ฒ•์ด ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

๋ฌผ๋ก  ๋‹ต๋ณ€ ์†Œ์Šค์ฝ”๋“œ์ค‘์—์„œ TabControl.Items.Remove(item); ์ด ๋ถ€๋ถ„์€ Exception์„ ๋ฐœ์ƒ์‹œํ‚ค๋Š” ์ฝ”๋“œ์ง€๋งŒ, ์ €๊ฒƒ๋งŒ ์ฃผ์„์ฒ˜๋ฆฌํ•˜๋ฉด ๋ฐ”์ธ๋”ฉ ์—๋Ÿฌ๋Š” ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

Code Behind๋ฅผ ํ†ตํ•ด TabItem์„ ์ถ”๊ฐ€ํ•˜๊ณ , Clearํ•˜๋Š” ๊ณผ์ •์—์„œ TabItem์˜ Template ์†์„ฑ์„ Null๋กœ ๋งŒ๋“œ๋Š” ๊ฒƒ์ด ์–ด๋–ค ๊ด€๊ณ„๊ฐ€ ์žˆ๋Š”์ง€ ๋ชจ๋ฅด๊ฒ ์ง€๋งŒ ๋ฐ”์ธ๋”ฉ ์˜ค๋ฅ˜๋Š” ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

ํ˜น์‹œ ์›์ธ์„ ์•„์‹œ๋Š” ๋ถ„์€ ๋‹ต๊ธ€๋กœ ์•Œ๋ ค์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹คโ€ฆ!!

์ข‹์•„์š” 3

์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š” ์˜ˆ์ œ๋ฅผ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค.

ํ…Œ์ŠคํŠธ ํ•ด๋ณด์‹œ๋ ค๋Š” ๋ถ„๊ป˜ ์ฐธ๊ณ ๋˜๊ธฐ๋ฅผ ๋ฐ”๋ž๋‹ˆ๋‹ค.

์ข‹์•„์š” 2

์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•ด ๋ณธ ๊ฒฐ๊ณผ, ์žฌํ˜„๋˜์ง€ ์•Š๊ณ  ๋‘˜ ๋‹ค ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š๊ณ  ์ •์ƒ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค.

์ข‹์•„์š” 3

์˜ค์ž‰โ€ฆํ˜น์‹œ readme ์ˆœ์„œ๋Œ€๋กœ ํ•˜์…จ๋‚˜์š”?? ์ œ๊ฐ€ ์†Œ์Šค๋Š” ์ •์ƒ ๋™์ž‘ํ•˜๋Š” ์†Œ์Šค๋ฅผ ์˜ฌ๋ ค๋†จ์Šต๋‹ˆ๋‹ค. ํ•œ ๋ถ„ ํ…Œ์ŠคํŠธ ํ•ด์ฃผ์‹  ๋ถ„์ด ๊ณ„์‹ ๋ฐ ๊ฑฐ๊ธฐ์„œ๋„ ๋™์ผํ•œ ์—๋Ÿฌ๊ฐ€ ๋‚˜์™”๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

์ข‹์•„์š” 2

์•„ ๋ฐ”์ธ๋”ฉ ์˜ค๋ฅ˜๊ตฐ์š”; ์ž˜๋ชป๋ดค์Šต๋‹ˆ๋‹ค. ๋ฐ”์ธ๋”ฉ ์˜ค๋ฅ˜๋Š” ๋ง์”€ํ•˜์‹  ๊ฒƒ ์ฒ˜๋Ÿผ 4๊ฐœ์”ฉ ๊ณ„์† ๋Š˜์–ด๋‚˜๋„ค์š”

์ข‹์•„์š” 3

๋„ค ํƒญ์˜ ๊ฐœ์ˆ˜๋ฅผ ๋ณ€๊ฒฝํ•ด๋„ ๊ณ„์† 4๊ฐœ ๋‹จ์œ„๋กœ ๋‚˜์˜ค๋Š”๊ฑธ๋ณด๋‹ˆ ํƒญํ•˜๊ณ ๋Š” ์ƒ๊ด€์—†์ด tabitem๊ณผ tabcontrol ๊ฐ„์— ๋ญ”๊ฐ€๊ฐ€ ์žˆ๋Š”๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹คโ€ฆ๊ทผ๋ฐ ๊ทธ๊ฒŒ ๋ญ”์ง€โ€ฆ tabstrap ์œผ๋กœ left right top bottom ๊ฐ™๊ธฐ๋„ ํ•œ๋ฐโ€ฆํ โ€ฆ

์ข‹์•„์š” 2

์ผ๋‹จ ํ˜„์ƒ์œผ๋กœ XAML์ด๋˜ CodeBehind์ด๋˜ 1๊ฐœ์”ฉ ์ถ”๊ฐ€ํ•  ๋•Œ๋Š” ๋ฐ”์ธ๋”ฉ ์˜ค๋ฅ˜๊ฐ€ ๋‚˜ํƒ€๋‚˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์ข‹์•„์š” 3

๋งˆ์ง€๋ง‰ (๋˜๋Š” ์ „์ฒด)๋ฅผ ์‚ญ์ œํ•  ๋•Œ ๋ฐœ์ƒํ•˜๋Š” ๋ฐ”์ธ๋”ฉ ์˜ค๋ฅ˜ (๋ฒ„๊ทธ) ์ธ๊ฑธ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค. ์•„๋ž˜์˜ ๋งํฌ๋Š” ์•„์ง ์Šน์ธ๋˜์ง€๋Š” ์•Š์•˜์ง€๋งŒ, ๋ฒ„๊ทธ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค.

์ข‹์•„์š” 3

์—ฌ๋Ÿฌ ์ผ€์ด์Šค๋ฅผ ํ…Œ์ŠคํŠธ ํ•ด๋ดค์Šต๋‹ˆ๋‹ค.


  1. TabItem์„ ์„ ํƒํ•œ ์ ์ด ์žˆ๋Š” ๊ฒฝ์šฐ
  • ์‚ญ์ œ ์ˆœ์„œ, ๋ฐฉ์‹๊ณผ ๋ฌด๊ด€ํ•˜๊ฒŒ ๋ฐ”์ธ๋”ฉ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์Œ

  1. TabItem์„ ์„ ํƒํ•œ ์ ์ด ์—†๋Š” ๊ฒฝ์šฐ
  • TabItem์˜ Template์ด ๊ธฐ๋ณธ๊ฐ’์ธ ๊ฒฝ์šฐ, TabControl์˜ Items๋ฅผ Clearํ•˜๊ฑฐ๋‚˜ ์ฒซ ๋ฒˆ์งธ ์ธ๋ฑ์Šค๋ฅผ ์‚ญ์ œํ•  ๋•Œ ๋ฐ”์ธ๋”ฉ ์˜ค๋ฅ˜ ๋ฐœ์ƒ

  • TabItem์˜ Template์ด ์ง€์ •๋œ ๊ฒฝ์šฐ, TabControl์˜ Items๋ฅผ Clearํ•  ๋•Œ๋Š” ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์ง€๋งŒ ์ฒซ ๋ฒˆ์งธ ์ธ๋ฑ์Šค๋ฅผ ์‚ญ์ œํ•  ๋•Œ ๋ฐ”์ธ๋”ฉ ์˜ค๋ฅ˜ ๋ฐœ์ƒ


  1. TabControl์„ ์ƒ์†๋ฐ›์€ MyTabControl์—์„œ ItemsChanged๋ฅผ overrideํ•œ ํ›„ ์ฃผ์„ ์ฒ˜๋ฆฌํ•ด ๋น„ํ™œ์„ฑํ™”ํ•œ ๊ฒฝ์šฐ
  • code behind ๋ฐฉ์‹์—์„œ๋Š” Clear์™€ Remove ๋ชจ๋‘ ๋ฐ”์ธ๋”ฉ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์Œ
  • ViewModel ๋ฐ”์ธ๋”ฉ ๋ฐฉ์‹์—์„œ๋Š” Clear์—์„œ๋Š” ๋ฐ”์ธ๋”ฉ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์ง€๋งŒ RemoveAt์œผ๋กœ ์ฒซ ๋ฒˆ์งธ ์ธ๋ฑ์Šค๋ฅผ ์‚ญ์ œํ•  ๋•Œ ๋ฐ”์ธ๋”ฉ ์˜ค๋ฅ˜ ๋ฐœ์ƒ

์•Œ๋‹ค๊ฐ€๋„ ๋ชจ๋ฅด๊ฒ ๊ตฐ์š”โ€ฆ

์ข‹์•„์š” 5

๋ฒ„๊ทธ์ธ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์ผ๋‹จ ์ž„์‹œ์ฑ…์ด์ง€๋งŒ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์€ TabControl์„ ํ•˜๋‚˜์”ฉ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ ์ž…๋‹ˆ๋‹ค.
ํ•˜๋‚˜์”ฉ ์ƒ์„ฑํ•  ๊ฒฝ์šฐ์—๋Š” ์ € ์˜ค๋ฅ˜๊ฐ€ ๋‚˜ํƒ€๋‚˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์ด๋กœ์จ ์ถ”์ธกํ•ด๋ณด์ž๋ฉด TabControl์— ์ƒˆ Tab์ด ์ถ”๊ฐ€๋œ ์ดํ›„ ๋‚ด๋ถ€์ ์œผ๋กœ ์–ด๋–ค ์ž‘์—…(๋˜๋Š” ์ด๋ฒคํŠธ)์ด ์žˆ๋Š”๋ฐ ๊ทธ์ชฝ์—์„œ ๋‹ค๋Ÿ‰์˜ ์•„์ดํ…œ์ด ๋™์‹œ์— ์‚ฝ์ž…๋  ๋•Œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•œ ๊ฒƒ์œผ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค.

์ข‹์•„์š” 5

@Vincent ๋„ต ๋งž์Šต๋‹ˆ๋‹ค.

TabItem์— TabStripPlacement (Left, Right, Top, Bottom) ๊ด€๋ จํ•ด์„œ MultiTrigger๊ฐ€ RelativeSource AncestorType ์œผ๋กœ ์ˆ˜์‹ญ ๊ฐœ ์ •์˜๋˜์–ด ์žˆ์–ด์š”.

๊ทธ๋ž˜์„œ ์‚ญ์ œํ•˜๊ธฐ ์ „์— Template์„ ์ œ๊ฑฐํ•˜์‹œ๋ฉด ๋ฌธ์ œ ์—†์—ˆ๋˜ ๊ฑฐ์ฃ . :smile:

Template์„ ์ƒˆ๋กญ๊ฒŒ ๋งŒ๋“œ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค!
๋ณดํ†ต TabItem Template์„ ์ปค์Šคํ„ฐ๋งˆ์ด์ง• ํ•˜๋‹ˆ๊นŒ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ํ•ด๊ฒฐ๋˜๋Š” ๋ฌธ์ œ ๊ฐ™์•„์š”.

<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
    <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
    <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
    <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
    <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
    <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
    <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
    <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
    <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
    <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
    <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
    <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
    <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Panel.ZIndex" Value="1"/>
    <Setter Property="Margin" Value="-2,-2,0,-2"/>
    <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Panel.ZIndex" Value="1"/>
    <Setter Property="Margin" Value="-2,0,-2,-2"/>
    <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Panel.ZIndex" Value="1"/>
    <Setter Property="Margin" Value="0,-2,-2,-2"/>
    <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
        <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Panel.ZIndex" Value="1"/>
    <Setter Property="Margin" Value="-2,-2,-2,0"/>
    <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
    <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
</MultiDataTrigger>
์ข‹์•„์š” 5