Add Phoenix remote desktop, action connector, documentation engine, and gamification support. Refactor support-case processing and search/action UI, and update installer assets and dependencies.
116 lines
4.1 KiB
C#
116 lines
4.1 KiB
C#
using F4SD_AdaptableIcon;
|
|
using F4SD_AdaptableIcon.Enums;
|
|
using FasdDesktopUi.Basics.Helper;
|
|
using FasdDesktopUi.Basics.Models;
|
|
using System;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
|
|
namespace FasdDesktopUi.Basics.UserControls
|
|
{
|
|
public partial class DetailedRecommendation : UserControl
|
|
{
|
|
#region Properties
|
|
|
|
#region RecommendationData
|
|
|
|
public static readonly DependencyProperty RecommendationDataProperty =
|
|
DependencyProperty.Register("RecommendationData", typeof(cRecommendationDataModel), typeof(DetailedRecommendation), new PropertyMetadata(new cRecommendationDataModel(), new PropertyChangedCallback(HandleRecommendationDataChanged)));
|
|
|
|
private static void HandleRecommendationDataChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
|
{
|
|
if (!(d is DetailedRecommendation recommendationUc))
|
|
return;
|
|
|
|
if (string.IsNullOrWhiteSpace(recommendationUc.RecommendationData?.Recommendation))
|
|
recommendationUc.Visibility = Visibility.Collapsed;
|
|
else
|
|
recommendationUc.Visibility = Visibility.Visible;
|
|
}
|
|
|
|
public cRecommendationDataModel RecommendationData
|
|
{
|
|
get { return (cRecommendationDataModel)GetValue(RecommendationDataProperty); }
|
|
set { SetValue(RecommendationDataProperty, value); }
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region IsCloseButtonVisible
|
|
|
|
public static readonly DependencyProperty IsCloseButtonVisibleProperty =
|
|
DependencyProperty.Register("IsCloseButtonVisible", typeof(bool), typeof(DetailedRecommendation), new PropertyMetadata(false));
|
|
|
|
public bool IsCloseButtonVisible
|
|
{
|
|
get { return (bool)GetValue(IsCloseButtonVisibleProperty); }
|
|
set { SetValue(IsCloseButtonVisibleProperty, value); }
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Icon
|
|
|
|
public IconData Icon
|
|
{
|
|
get { return (IconData)GetValue(IconProperty); }
|
|
set { SetValue(IconProperty, value); }
|
|
}
|
|
|
|
public static readonly DependencyProperty IconProperty =
|
|
DependencyProperty.Register("Icon", typeof(IconData), typeof(DetailedRecommendation), new PropertyMetadata(new IconData(enumInternIcons.status_info), HandleIconChanged));
|
|
|
|
private static void HandleIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
|
{
|
|
if (d is DetailedRecommendation recommendation && e.NewValue is IconData iconData)
|
|
{
|
|
IconHelper.SetIconValue(recommendation.RecommendationIcon, iconData);
|
|
}
|
|
}
|
|
|
|
public string PrimaryIconColorResourceName
|
|
{
|
|
get { return (string)GetValue(PrimaryIconColorResourceNameProperty); }
|
|
set { SetValue(PrimaryIconColorResourceNameProperty, value); }
|
|
}
|
|
|
|
public static readonly DependencyProperty PrimaryIconColorResourceNameProperty =
|
|
DependencyProperty.Register("PrimaryIconColorResourceName", typeof(string), typeof(DetailedRecommendation), new PropertyMetadata("Color.Blue", HandleColorChanged));
|
|
|
|
private static void HandleColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
|
{
|
|
if (d is DetailedRecommendation recommendation)
|
|
{
|
|
recommendation.RecommendationIcon.SetResourceReference(AdaptableIcon.AdaptableIcon.PrimaryIconColorProperty, e.NewValue);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
public Action CloseButtonClickedAction { get; set; }
|
|
|
|
#endregion
|
|
|
|
public DetailedRecommendation()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void CloseButton_Click()
|
|
{
|
|
CloseButtonClickedAction?.Invoke();
|
|
}
|
|
|
|
private void CloseButton_MouseUp(object sender, MouseButtonEventArgs e)
|
|
{
|
|
CloseButton_Click();
|
|
}
|
|
|
|
private void CloseButton_TouchDown(object sender, TouchEventArgs e)
|
|
{
|
|
CloseButton_Click();
|
|
}
|
|
}
|
|
}
|