Improve active tab indicator with modern accent rail
This commit is contained in:
@@ -900,6 +900,13 @@ namespace C4IT_CustomerPanel
|
||||
}
|
||||
}
|
||||
|
||||
private FrameworkElement GetActiveTabIndicator(Button button)
|
||||
{
|
||||
return button == null
|
||||
? null
|
||||
: visualHelper.FindVisualChild<FrameworkElement>(button, "ActiveIndicator");
|
||||
}
|
||||
|
||||
public void SetMenuAktivInaktiv(object sender, bool force, bool Silent = false)
|
||||
{
|
||||
Button clickedButton = (Button)sender;
|
||||
@@ -912,17 +919,17 @@ namespace C4IT_CustomerPanel
|
||||
{
|
||||
clickedButton.Background = btnColor1;
|
||||
|
||||
System.Windows.Shapes.Polygon polyActiveButton = visualHelper.FindVisualChild<System.Windows.Shapes.Polygon>(clickedButton);
|
||||
if (polyActiveButton != null)
|
||||
polyActiveButton.Visibility = Visibility.Visible;
|
||||
FrameworkElement activeIndicator = GetActiveTabIndicator(clickedButton);
|
||||
if (activeIndicator != null)
|
||||
activeIndicator.Visibility = Visibility.Visible;
|
||||
}
|
||||
SolidColorBrush btnColor2 = this.ConfigSettings.GetInactiveButtonColor();
|
||||
if (btnColor2 != null && ActiveButton != null)
|
||||
{
|
||||
ActiveButton.Background = btnColor2;
|
||||
System.Windows.Shapes.Polygon polyInActiveButton = visualHelper.FindVisualChild<System.Windows.Shapes.Polygon>(ActiveButton);
|
||||
if (polyInActiveButton != null)
|
||||
polyInActiveButton.Visibility = Visibility.Hidden;
|
||||
FrameworkElement inactiveIndicator = GetActiveTabIndicator(ActiveButton);
|
||||
if (inactiveIndicator != null)
|
||||
inactiveIndicator.Visibility = Visibility.Hidden;
|
||||
}
|
||||
ActiveButton = clickedButton;
|
||||
}
|
||||
@@ -1720,13 +1727,13 @@ namespace C4IT_CustomerPanel
|
||||
Img.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
// check, if active button -> show advanced polygon
|
||||
// check, if active button -> show active tab indicator
|
||||
if (bu != ActiveButton)
|
||||
return;
|
||||
|
||||
System.Windows.Shapes.Polygon polyActiveButton = visualHelper.FindVisualChild<System.Windows.Shapes.Polygon>(bu);
|
||||
if (polyActiveButton != null)
|
||||
polyActiveButton.Visibility = Visibility.Visible;
|
||||
FrameworkElement activeIndicator = GetActiveTabIndicator(bu);
|
||||
if (activeIndicator != null)
|
||||
activeIndicator.Visibility = Visibility.Visible;
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user