Skip to content
This repository was archived by the owner on Nov 25, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,40 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<Style TargetType="StackPanel" x:Key="SpLayerNameStyle">
<Setter Property="Height" Value="100" />
<Setter Property="Width" Value="180" />
<Setter Property="Margin" Value="0,25,0,0" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Top" />
</Style>

<Style TargetType="StackPanel" x:Key="SpControlHintStyle">
<Setter Property="Margin" Value="0,0,10,10" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Bottom" />
</Style>

<Style TargetType="TextBlock" x:Key="TextblockLayerNameStyle">
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="Margin" Value="5,5,5,0" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="TextWrapping" Value="WrapWithOverflow" />
</Style>

<Style TargetType="TextBlock" BasedOn="{StaticResource TextblockLayerNameStyle}" x:Key="TbLayerNameTitleStyle">
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="Foreground" Value="#BBB" />
<Setter Property="FontSize" Value="14" />
</Style>

<Style TargetType="TextBlock" BasedOn="{StaticResource TextblockLayerNameStyle}" x:Key="TbLayerNameStyle">
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="Foreground" Value="#555" />
<Setter Property="FontSize" Value="16" />
</Style>

<Style TargetType="TextBlock" BasedOn="{StaticResource TextblockLayerNameStyle}" x:Key="TbControlHintStyle">
<Setter Property="TextAlignment" Value="Right" />
<Setter Property="Foreground" Value="#555" />
<Setter Property="FontSize" Value="12" />
</Style>


</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,18 @@
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>

<StackPanel Style="{StaticResource SpLayerNameStyle}"
Visibility="{Binding NoLayoutAvailable, Converter={StaticResource BoolToVisibleConverter}}">
<TextBlock Text="{Binding CurrentLayerNameTitle}" Style="{StaticResource TbLayerNameTitleStyle}" />
<TextBlock Text="{Binding CurrentLayerName}" Style="{StaticResource TbLayerNameStyle}" />
</StackPanel>

<StackPanel Style="{StaticResource SpControlHintStyle}"
Visibility="{Binding NoLayoutAvailable, Converter={StaticResource BoolToVisibleConverter}}">
<TextBlock Text="{Binding ControlHintLabel}" Style="{StaticResource TbControlHintStyle}" />
</StackPanel>

<Grid Visibility="{Binding NoLayoutAvailable, Converter={StaticResource BoolToHiddenConverter}}" Width="350">
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".25*"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class DisplayLayoutViewModel : ViewModelBase
private string _noLayoutWarningSecondLine;
private string _currentLayerNameTitle;
private string _currentLayerName;
private string _controlHintLabel;
private bool _noLayoutAvailable;

#endregion
Expand Down Expand Up @@ -94,6 +95,15 @@ public string CurrentLayerName
private set => Set(ref _currentLayerName, value);
}

/// <summary>
/// Gets or sets the control hint label.
/// </summary>
public string ControlHintLabel
{
get => _controlHintLabel;
private set => Set(ref _controlHintLabel, value);
}

/// <summary>
/// Gets or sets the no layout available indicator.
/// </summary>
Expand Down Expand Up @@ -166,6 +176,7 @@ private void SetLabelUi()
NoLayoutWarningSecondLine = "Please, go to the settings and update the layout.";
CurrentLayerNameTitle = "Current layer :";
CurrentLayerName = "";
ControlHintLabel = "Press 'Space' to display next layer";
}

private async void LoadCompleteLayout()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace InvvardDev.EZLayoutDisplay.Tests.ViewModel
public class DisplayLayoutViewModelTest
{
[ Fact ]
public void DisplayLayoutViewModelConstructor()
public void DisplayLayoutViewModel_Constructor()
{
//Arrange
var mockWindowService = new Mock<IWindowService>();
Expand Down Expand Up @@ -40,6 +40,7 @@ public void DisplayLayoutViewModelConstructor()
Assert.Equal("Please, go to the settings and update the layout.", displayLayoutViewModel.NoLayoutWarningSecondLine);
Assert.Equal("Current layer :", displayLayoutViewModel.CurrentLayerNameTitle);
Assert.Equal("", displayLayoutViewModel.CurrentLayerName);
Assert.Equal("Press 'Space' to display next layer", displayLayoutViewModel.ControlHintLabel);
}

[ Fact ]
Expand Down