Skip to content

Commit

Permalink
header - show expansion state by filling out the icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Rehkemper committed Jan 27, 2022
1 parent 0029063 commit a002a78
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
d:DesignHeight="450"
d:DesignWidth="800"
Height="58px">
d:DesignWidth="800">
<UserControl.Resources>
<Style TargetType="md:PackIcon">
<Setter Property="Width"
Expand All @@ -26,13 +25,15 @@
Value="16 0" />
<Setter Property="Background"
Value="Transparent" />
<Setter Property="BorderBrush"
Value="Transparent" />
</Style>
<Style TargetType="ToggleButton" BasedOn="{StaticResource MaterialDesignActionToggleButton}">
<Setter Property="Foreground"
Value="{DynamicResource MaterialDesignDarkForeground}" />
</Style>
</UserControl.Resources>
<md:ColorZone Padding="16 0"
<md:ColorZone Padding="16 8"
UseLayoutRounding="True"
VerticalAlignment="Stretch"
md:ShadowAssist.ShadowDepth="Depth2"
Expand All @@ -53,7 +54,7 @@
<Button x:Name="Save"
Content="{md:PackIcon ContentSave}"
BorderBrush="Transparent"
ToolTip="Save Data - Coming Soon" />
ToolTip="Save" />
</StackPanel>
<!-- Right -->
<StackPanel Orientation="Horizontal"
Expand Down Expand Up @@ -81,23 +82,23 @@
UseLayoutRounding="True"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<md:PackIcon Kind="clock" />
<md:PackIcon Name="JobToggleIcon"/>
</Button>
</Grid>
</md:Badged>
<!--notifications-->
<md:Badged x:Name="NotificationBadge"
<md:Badged x:Name="NotificationToggleBadge"
ToolTip="Number of Notifications"
BadgePlacementMode="BottomRight"
VerticalAlignment="Center"
Padding="0 -10 -20 -10"
Margin="-20 0 0 0">
<Button Content="{md:PackIcon Bell}"
ToolTip="Notifications"
<Button ToolTip="Notifications"
md:RippleAssist.IsDisabled="False"
x:Name="ShowNotificationSidebar" />
x:Name="NotificationToggle">
<md:PackIcon Name="NotificationToggleIcon"/>
</Button>
</md:Badged>

</StackPanel>
<!-- Center -->
<TextBlock x:Name="CurrentPageTitle"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Reactive.Linq;
using System.Windows;
using System.Windows.Media;
using MaterialDesignThemes.Wpf;
using ReactiveUI;
using TableTopCrucible.Core.Wpf.Engine.UserControls.ViewModels;

Expand Down Expand Up @@ -29,7 +30,7 @@ public AppHeaderV()
? string.Empty
: count.ToString())
.ObserveOn(RxApp.MainThreadScheduler)
.BindTo(this, v => v.NotificationBadge.Badge),
.BindTo(this, v => v.NotificationToggleBadge.Badge),

ViewModel!.JobCountChanges
.Select(c =>
Expand Down Expand Up @@ -58,14 +59,14 @@ public AppHeaderV()

ViewModel!.IsNotificationSidebarSelectedChanged
.Select(selected => selected
? buttonBorderSelected
: buttonBorder)
.BindTo(this, v => v.ShowNotificationSidebar.BorderBrush),
? PackIconKind.Bell
: PackIconKind.BellOutline)
.BindTo(this, v => v.NotificationToggleIcon.Kind),
ViewModel!.IsJobQueueSelectedChanged
.Select(selected => selected
? buttonBorderSelected
: buttonBorder)
.BindTo(this, v => v.ShowJobSidebar.BorderBrush),
? PackIconKind.Clock
: PackIconKind.ClockOutline)
.BindTo(this, v => v.JobToggleIcon.Kind),

this.Bind(ViewModel,
vm => vm.IsNavigationBarExpanded,
Expand All @@ -89,7 +90,7 @@ public AppHeaderV()

this.OneWayBind(ViewModel,
vm => vm.ShowNotificationSidebar,
v => v.ShowNotificationSidebar.Command)
v => v.NotificationToggle.Command)
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace TableTopCrucible.Shared.Wpf.UserControls.Views.ItemControls
/// <summary>
/// Interaction logic for ItemListV.xaml
/// </summary>
public partial class ItemListV : ReactiveUserControl<ItemListVm>, IActivatableView
public partial class ItemListV : ReactiveUserControl<ItemListVm>
{
public ItemListV()
{
Expand Down

0 comments on commit a002a78

Please sign in to comment.