Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed issue with missing PrimaryLight multitrigger
Fixed failing UI test, and updated relative source bindings to target TabControl directly
  • Loading branch information
Keboo committed Jul 15, 2022
commit 536f8a0cc8537197e51d655548bef1ddebfc79bd
14 changes: 7 additions & 7 deletions MainDemo.Wpf/Tabs.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@

<smtx:XamlDisplay Margin="0,0,16,16" UniqueKey="tabs_2">
<TabControl Width="300" materialDesign:ColorZoneAssist.Mode="PrimaryMid">
<TabItem Header="TAB 1">
<TextBlock Margin="8" Text="PrimaryMid Tab 1" />
</TabItem>
<TabItem Header="TAB 2">
<TextBlock Margin="8" Text="PrimaryMid Tab 2" />
</TabItem>
</TabControl>
<TabItem Header="TAB 1">
<TextBlock Margin="8" Text="PrimaryMid Tab 1" />
</TabItem>
<TabItem Header="TAB 2">
<TextBlock Margin="8" Text="PrimaryMid Tab 2" />
</TabItem>
</TabControl>
</smtx:XamlDisplay>

<smtx:XamlDisplay Margin="0,0,16,16" UniqueKey="tabs_3">
Expand Down
4 changes: 1 addition & 3 deletions MaterialDesignThemes.UITests/MaterialDesignSpec.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Threading.Tasks;
using System.Windows.Media;
using System.Windows.Media;
using MaterialDesignColors.ColorManipulation;
using Xunit;

namespace MaterialDesignThemes.UITests;

Expand Down
7 changes: 0 additions & 7 deletions MaterialDesignThemes.UITests/TestBase.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media;
using MaterialDesignThemes.Wpf;
using XamlTest;
using Xunit;
using Xunit.Abstractions;

[assembly: CollectionBehavior(DisableTestParallelization = true)]
[assembly: GenerateHelpers(typeof(SmartHint))]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using System.ComponentModel;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media;
using XamlTest;
using Xunit;
using Xunit.Abstractions;

namespace MaterialDesignThemes.UITests.WPF.TabControls;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@
</Setter>
</Style>

<Style
x:Key="MaterialDesignTabControl"
<Style x:Key="MaterialDesignTabControl"
BasedOn="{StaticResource MaterialDesignTabControlBase}"
TargetType="{x:Type TabControl}">
<Setter Property="Background" Value="Transparent" />
Expand All @@ -143,8 +142,7 @@
<Setter Property="wpf:ColorZoneAssist.Background" Value="Transparent" />
</Style>

<Style
x:Key="MaterialDesignFilledTabControl"
<Style x:Key="MaterialDesignFilledTabControl"
BasedOn="{StaticResource MaterialDesignTabControlBase}"
TargetType="{x:Type TabControl}">
<Setter Property="wpf:TabAssist.HasFilledTab" Value="True" />
Expand Down Expand Up @@ -189,16 +187,16 @@
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
<Setter Property="Background" Value="Transparent" />
<!-- Foreground is for the content, not the header -->
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabControl}}, Path=(TextElement.Foreground)}" />
<Setter Property="Padding" Value="16,12" />
<Setter Property="Height" Value="48" />
<Setter Property="MinWidth" Value="90" />
<Setter Property="MaxWidth" Value="360" />
<Setter Property="wpf:RippleAssist.Feedback" Value="{DynamicResource MaterialDesignFlatButtonRipple}" />
<Setter Property="wpf:ColorZoneAssist.Mode" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(wpf:ColorZoneAssist.Mode)}" />
<Setter Property="wpf:ColorZoneAssist.Mode" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabControl}}, Path=(wpf:ColorZoneAssist.Mode)}" />
<Setter Property="wpf:ColorZoneAssist.Background" Value="Transparent" />
<Setter Property="wpf:ColorZoneAssist.Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(wpf:ColorZoneAssist.Foreground)}" />
<Setter Property="wpf:TabAssist.HasFilledTab" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(wpf:TabAssist.HasFilledTab)}" />
<Setter Property="wpf:ColorZoneAssist.Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabControl}}, Path=(wpf:ColorZoneAssist.Foreground)}" />
<Setter Property="wpf:TabAssist.HasFilledTab" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabControl}}, Path=(wpf:TabAssist.HasFilledTab)}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
Expand Down Expand Up @@ -317,6 +315,14 @@
</MultiTrigger.Conditions>
<Setter TargetName="ColorZoneHeader" Property="wpf:ColorZoneAssist.Foreground" Value="{DynamicResource MaterialDesignBody}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="wpf:TabAssist.HasFilledTab" Value="False" />
<Condition Property="IsSelected" Value="True" />
<Condition Property="wpf:ColorZoneAssist.Mode" Value="PrimaryLight" />
</MultiTrigger.Conditions>
<Setter TargetName="ColorZoneHeader" Property="wpf:ColorZoneAssist.Foreground" Value="{DynamicResource PrimaryHueLightBrush}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="wpf:TabAssist.HasFilledTab" Value="False" />
Expand Down