Skip to content

Commit

Permalink
Added Description parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKert committed Mar 19, 2019
1 parent d7d1747 commit 09983f2
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ static ErrorProjectsIndicator()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ErrorProjectsIndicator), new FrameworkPropertyMetadata(typeof(ErrorProjectsIndicator)));
}

public ErrorProjectsIndicator()
{
Description = UI.Resources.ErrorProjectsIndicator_Header;
}
}
}
5 changes: 5 additions & 0 deletions src/BuildVision.UI/Controls/Indicators/ErrorsIndicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ static ErrorsIndicator()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ErrorsIndicator), new FrameworkPropertyMetadata(typeof(ErrorsIndicator)));
}

public ErrorsIndicator()
{
Description = UI.Resources.ErrorsIndicator_Header;
}
}
}
5 changes: 5 additions & 0 deletions src/BuildVision.UI/Controls/Indicators/MessagesIndicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ static MessagesIndicator()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(MessagesIndicator), new FrameworkPropertyMetadata(typeof(MessagesIndicator)));
}

public MessagesIndicator()
{
Description = UI.Resources.MessagesIndicator_Header;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ static SuccessProjectsIndicator()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(SuccessProjectsIndicator), new FrameworkPropertyMetadata(typeof(SuccessProjectsIndicator)));
}

public SuccessProjectsIndicator()
{
Description = UI.Resources.SuccessProjectsIndicator_Header;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ static UpToDateProjectsIndicator()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(UpToDateProjectsIndicator), new FrameworkPropertyMetadata(typeof(UpToDateProjectsIndicator)));
}

public UpToDateProjectsIndicator()
{
Description = UI.Resources.UpToDateProjectsIndicator_Header;
}
}
}
10 changes: 9 additions & 1 deletion src/BuildVision.UI/Controls/Indicators/ValueIndicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ namespace BuildVision.UI.Controls.Indicators
{
public class ValueIndicator : Control
{
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register(nameof(Description), typeof(string), typeof(ValueIndicator));

public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
"Value",
nameof(Value),
typeof(long),
typeof(ValueIndicator),
new FrameworkPropertyMetadata(
Expand All @@ -30,6 +32,12 @@ public long Value
set { SetValue(ValueProperty, value); }
}

public string Description
{
get { return (string)GetValue(DescriptionProperty); }
set { SetValue(DescriptionProperty, value); }
}

static void OnValueChange(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
d.SetValue(ValueProperty, (long) e.NewValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ static WarningProjectsIndicator()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(WarningProjectsIndicator), new FrameworkPropertyMetadata(typeof(WarningProjectsIndicator)));
}

public WarningProjectsIndicator()
{
Description = UI.Resources.WarningProjectsIndicator_Header;
}
}
}
5 changes: 5 additions & 0 deletions src/BuildVision.UI/Controls/Indicators/WarningsIndicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ static WarningsIndicator()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(WarningsIndicator), new FrameworkPropertyMetadata(typeof(WarningsIndicator)));
}

public WarningsIndicator()
{
Description = UI.Resources.WarningsIndicator_Header;
}
}
}
16 changes: 8 additions & 8 deletions src/BuildVision.UI/Themes/Generic.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type indicators:ErrorProjectsIndicator}">
<StackPanel Orientation="Vertical">
<Grid ToolTip="{x:Static res:Resources.ErrorsIndicator_Header}">
<Grid ToolTip="{TemplateBinding Description}" ToolTipService.ShowOnDisabled="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
Expand All @@ -77,7 +77,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type indicators:WarningProjectsIndicator}">
<StackPanel Orientation="Vertical">
<Grid ToolTip="{x:Static res:Resources.WarningProjectsIndicator_Header}">
<Grid ToolTip="{TemplateBinding Description}" ToolTipService.ShowOnDisabled="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
Expand All @@ -102,7 +102,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type indicators:SuccessProjectsIndicator}">
<StackPanel Orientation="Vertical">
<Grid ToolTip="{x:Static res:Resources.SuccessProjectsIndicator_Header}">
<Grid ToolTip="{TemplateBinding Description}" ToolTipService.ShowOnDisabled="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
Expand All @@ -125,9 +125,9 @@
<Style TargetType="{x:Type indicators:UpToDateProjectsIndicator}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type indicators:UpToDateProjectsIndicator}">
<ControlTemplate TargetType="{x:Type indicators:UpToDateProjectsIndicator}" >
<StackPanel Orientation="Vertical">
<Grid ToolTip="{x:Static res:Resources.UpToDateProjectsIndicator_Header}">
<Grid ToolTip="{TemplateBinding Description}" ToolTipService.ShowOnDisabled="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
Expand All @@ -152,7 +152,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type indicators:ErrorsIndicator}">
<StackPanel Orientation="Vertical">
<Grid ToolTip="{x:Static res:Resources.ErrorsIndicator_Header}" ToolTipService.ShowOnDisabled="True">
<Grid ToolTip="{TemplateBinding Description}" ToolTipService.ShowOnDisabled="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
Expand All @@ -177,7 +177,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type indicators:WarningsIndicator}">
<StackPanel Orientation="Vertical">
<Grid ToolTip="{x:Static res:Resources.WarningsIndicator_Header}" ToolTipService.ShowOnDisabled="True">
<Grid ToolTip="{TemplateBinding Description}" ToolTipService.ShowOnDisabled="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
Expand All @@ -202,7 +202,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type indicators:MessagesIndicator}">
<StackPanel Orientation="Vertical">
<Grid ToolTip="{x:Static res:Resources.MessagesIndicator_Header}" ToolTipService.ShowOnDisabled="True">
<Grid ToolTip="{TemplateBinding Description}" ToolTipService.ShowOnDisabled="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
Expand Down

0 comments on commit 09983f2

Please sign in to comment.