aktueller Stand
This commit is contained in:
@@ -90,12 +90,11 @@
|
||||
<Border x:Name="DialogCloseElement"
|
||||
x:FieldModifier="private"
|
||||
DockPanel.Dock="Bottom"
|
||||
Width="{Binding ElementName=WindowStateBarUserControl, Path=ActualWidth}"
|
||||
HorizontalAlignment="Right"
|
||||
Cursor="Hand"
|
||||
CornerRadius="5"
|
||||
Margin="0 2.5 7.5 -30"
|
||||
Padding="0 2.5"
|
||||
Padding="10 2.5"
|
||||
Background="{DynamicResource BackgroundColor.DetailsPage.Widget.Value}"
|
||||
MouseLeftButtonUp="CloseCaseWithTicketIcon_MouseLeftButtonUp"
|
||||
TouchDown="CloseCaseWithTicketIcon_TouchDown">
|
||||
@@ -220,8 +219,7 @@
|
||||
<uc:DetailsPageWidgetCollection x:Name="WidgetCollection"
|
||||
Grid.Row="1"
|
||||
Margin="0 35 0 10"
|
||||
WidgetGeometryList="{Binding WidgetGeometryList}"
|
||||
WidgetDataList="{Binding WidgetDataList}" />
|
||||
WidgetGeometryList="{Binding WidgetGeometryList}" />
|
||||
|
||||
<uc:DetailsPageRefreshControl x:Name="RefreshControl"
|
||||
Grid.Row="2"
|
||||
|
||||
@@ -31,8 +31,7 @@ using static C4IT.Logging.cLogManager;
|
||||
using F4SD_AdaptableIcon.Enums;
|
||||
using FasdDesktopUi.Basics.CustomEvents;
|
||||
using FasdDesktopUi.Basics.Converter;
|
||||
using FasdDesktopUi.Basics.Services.SupportCase;
|
||||
using FasdDesktopUi.Basics.Services.RelationService;
|
||||
using FasdDesktopUi.Basics.Services.SupportCase.Controllers;
|
||||
|
||||
namespace FasdDesktopUi.Pages.DetailsPage
|
||||
{
|
||||
@@ -54,7 +53,9 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
private bool isQuickActionDecoratorVisible = false;
|
||||
private bool isNotepadDecoratorVisible = false;
|
||||
|
||||
private DispatcherTimer midnightTimer = new DispatcherTimer();
|
||||
private readonly DispatcherTimer _midnightTimer = new DispatcherTimer();
|
||||
|
||||
private double _lastDesiredHeightOfWidgetCollection = 0; // to avoid resizing the main grid on every data changed event
|
||||
|
||||
#region Notepad
|
||||
|
||||
@@ -131,9 +132,9 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
try
|
||||
{
|
||||
InitializeComponent();
|
||||
midnightTimer.Interval = TimeSpan.FromSeconds(1);
|
||||
midnightTimer.Tick += MidnightTimer_Tick;
|
||||
midnightTimer.Start();
|
||||
_midnightTimer.Interval = TimeSpan.FromSeconds(1);
|
||||
_midnightTimer.Tick += MidnightTimer_Tick;
|
||||
_midnightTimer.Start();
|
||||
SupportNotepad = true;
|
||||
|
||||
var _screen = System.Windows.Forms.Screen.PrimaryScreen;
|
||||
@@ -159,44 +160,150 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
BlurInvoker.BlurInvokerVisibilityChanged -= (obj, e) => UpdateBlurStatus(obj);
|
||||
}
|
||||
|
||||
public override void SetSupportCase(ISupportCase supportCase)
|
||||
internal override void SetSupportCaseController(SupportCaseController supportCaseController)
|
||||
{
|
||||
if (_supportCase != null)
|
||||
_supportCase.CaseRelationsAdded -= HandleCaseRelationsAdded;
|
||||
if (_supportCaseController != null)
|
||||
UnsubscribeEventsOf(_supportCaseController);
|
||||
|
||||
supportCase.CaseRelationsAdded += HandleCaseRelationsAdded;
|
||||
base.SetSupportCase(supportCase);
|
||||
ResetPageToDefaultState();
|
||||
SubscribeEventsOf(supportCaseController);
|
||||
|
||||
base.SetSupportCaseController(supportCaseController);
|
||||
|
||||
NavigationHeadingUc.SupportCaseController = supportCaseController;
|
||||
IsBlurred = true;
|
||||
|
||||
RefreshControl.DataProvider = supportCase.SupportCaseDataProviderArtifact;
|
||||
NavigationHeadingUc.DataProvider = supportCase.SupportCaseDataProviderArtifact;
|
||||
RefreshControl.DataProvider = supportCaseController.SupportCaseDataProviderArtifact;
|
||||
NavigationHeadingUc.DataProvider = supportCaseController.SupportCaseDataProviderArtifact;
|
||||
|
||||
cSupportCaseDataProvider.CaseChanged += DataProvider_CaseChanged;
|
||||
|
||||
RefreshControl.IsDataIncomplete = true;
|
||||
RefreshControl.LoadingDataIndicatorUc.LoadingText = cMultiLanguageSupport.GetItem("DetailsPage.Loading");
|
||||
CustomizableSectionUc.IsDataIncomplete = true;
|
||||
supportCase.SupportCaseDataProviderArtifact.NotepadDocumentUpdated += ResetNotepadNotification;
|
||||
supportCaseController.SupportCaseDataProviderArtifact.NotepadDocumentUpdated += ResetNotepadNotification;
|
||||
|
||||
void SubscribeEventsOf(SupportCaseController controller)
|
||||
{
|
||||
controller.AvailableCaseRelationsAdded += HandleAvailableRelationsAdded;
|
||||
controller.FocusedRelationsChanged += HandleFocusedRelationsChanged;
|
||||
controller.CaseDataChanged += HandleCaseDataChanged;
|
||||
controller.HeadingDataChanged += HandleHeadingDataChanged;
|
||||
}
|
||||
|
||||
void UnsubscribeEventsOf(SupportCaseController controller)
|
||||
{
|
||||
controller.AvailableCaseRelationsAdded -= HandleAvailableRelationsAdded;
|
||||
controller.FocusedRelationsChanged -= HandleFocusedRelationsChanged;
|
||||
controller.CaseDataChanged -= HandleCaseDataChanged;
|
||||
controller.HeadingDataChanged -= HandleHeadingDataChanged;
|
||||
}
|
||||
}
|
||||
|
||||
private async void HandleCaseRelationsAdded(object sender, RelationEventArgs e)
|
||||
private void HandleAvailableRelationsAdded(object sender, RelationEventArgs e)
|
||||
{
|
||||
await Dispatcher.Invoke(async () =>
|
||||
}
|
||||
|
||||
private void HandleFocusedRelationsChanged(object sender, RelationEventArgs e)
|
||||
{
|
||||
IsBlurred = false;
|
||||
_supportCaseController.SupportCaseDataProviderArtifact.Identities = e.Relations.FirstOrDefault()?.FirstOrDefault()?.Identities; // todo remove when ShowDetailedDataAction is not dependent on Artifact anymore
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
NavigationHeadingUc.HeadingData = _supportCase?.SupportCaseDataProviderArtifact.HealthCardDataHelper.GetHeadingDataWithoutOnlineStatus();
|
||||
NavigationHeadingUc.HeadingData = await _supportCase?.SupportCaseDataProviderArtifact.HealthCardDataHelper.UpdateOnlineStatusAsync();
|
||||
ResetPageToDefaultState();
|
||||
UpdateHealthcardSectionVisibilities();
|
||||
HandleCaseDataChanged(null, null);
|
||||
});
|
||||
}
|
||||
|
||||
private void HandleHeadingDataChanged(object sender, HeadingDataEventArgs e)
|
||||
{
|
||||
Dispatcher.Invoke(() => NavigationHeadingUc.HeadingData = e.NewValue.ToList());
|
||||
}
|
||||
|
||||
// todo update NavigationHeadingUc_HeadingIconClickedEvent as soon as EventArgs are taken into account
|
||||
private void HandleCaseDataChanged(object sender, SupportCaseDataEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (isDataChangedEventRunning)
|
||||
{
|
||||
shouldReRunDataChangedEvent = true;
|
||||
return;
|
||||
}
|
||||
|
||||
isDataChangedEventRunning = true;
|
||||
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
if (QuickActionDecorator.Child is DataCanvas dataCanvas)
|
||||
Dispatcher.Invoke(async () => await dataCanvas.UpdateDataAsync());
|
||||
|
||||
if (WidgetCollection.WidgetDataList is null || WidgetCollection.WidgetDataList.Count == 0)
|
||||
WidgetCollection.WidgetDataList = _supportCaseController?.GetWidgetData();
|
||||
|
||||
WidgetCollection.UpdateWidgetData(_supportCaseController?.GetWidgetData());
|
||||
|
||||
if (DataHistoryCollectionUserControl.HistoryDataList is null || DataHistoryCollectionUserControl.HistoryDataList.Count == 0)
|
||||
DataHistoryCollectionUserControl.HistoryDataList = _supportCaseController?.GetHistoryData();
|
||||
|
||||
DataHistoryCollectionUserControl.UpdateHistory(_supportCaseController?.GetHistoryData());
|
||||
|
||||
if (CustomizableSectionUc.ContainerCollections is null || CustomizableSectionUc.ContainerCollections.Count == 0)
|
||||
CustomizableSectionUc.ContainerCollections = _supportCaseController?.GetContainerData();
|
||||
|
||||
CustomizableSectionUc.UpdateContainerCollection(_supportCaseController?.GetContainerData());
|
||||
|
||||
if (this.DataContext is DetailsPageViewModel viewModel)
|
||||
viewModel.MenuBarData = _supportCaseController?.GetMenuBarData();
|
||||
|
||||
if (_lastDesiredHeightOfWidgetCollection != WidgetCollection.DesiredSize.Height)
|
||||
{
|
||||
_lastDesiredHeightOfWidgetCollection = WidgetCollection.DesiredSize.Height;
|
||||
MainGrid.InvalidateMeasure();
|
||||
MainGrid.UpdateLayout();
|
||||
}
|
||||
});
|
||||
|
||||
if (shouldReRunDataChangedEvent)
|
||||
HandleCaseDataChanged(sender, e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
isDataChangedEventRunning = false;
|
||||
shouldReRunDataChangedEvent = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the visibility of History and Customizable Section based on the currently selected Healthcard.
|
||||
/// </summary>
|
||||
internal void UpdateHealthcardSectionVisibilities()
|
||||
{
|
||||
try
|
||||
{
|
||||
cHealthCard selectedHealthcard = _supportCaseController.SupportCaseDataProviderArtifact.HealthCardDataHelper.SelectedHealthCard;
|
||||
bool showHistorySection = selectedHealthcard.CategoriesHistory?.StateCategories != null && selectedHealthcard.CategoriesHistory.StateCategories.Count > 0;
|
||||
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
DataHistoryCollectionUserControl.Visibility = showHistorySection ? Visibility.Visible : Visibility.Collapsed;
|
||||
CustomizableSectionUc.Visibility = showHistorySection ? Visibility.Collapsed : Visibility.Visible;
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReinitializeNotepad()
|
||||
{
|
||||
|
||||
if (SupportNotepad == true)
|
||||
{
|
||||
|
||||
notepad = new Notepad(_supportCase?.SupportCaseDataProviderArtifact);
|
||||
notepad = new Notepad(_supportCaseController?.SupportCaseDataProviderArtifact);
|
||||
ChangeNotepadNotification();
|
||||
NotepadDecorator.Child = notepad;
|
||||
NotepadDecorator.Visibility = Visibility.Collapsed;
|
||||
@@ -319,31 +426,34 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
{
|
||||
try
|
||||
{
|
||||
Panel.SetZIndex(NavigationHeadingUc, 1);
|
||||
NavigationHeadingUc.ResetSelectors();
|
||||
|
||||
if (cConnectionStatusHelper.Instance?.ApiConnectionStatus == cConnectionStatusHelper.enumOnlineStatus.online)
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
SearchBarUserControl.Visibility = Visibility.Collapsed;
|
||||
SearchBarUserControl.Clear();
|
||||
MenuBarUserControl.Visibility = Visibility.Visible;
|
||||
}
|
||||
Panel.SetZIndex(NavigationHeadingUc, 1);
|
||||
NavigationHeadingUc.ResetSelectors();
|
||||
|
||||
SearchResultBorder.Visibility = Visibility.Collapsed;
|
||||
|
||||
OverlayBorder.Child = null;
|
||||
OverlayBorder.Visibility = Visibility.Collapsed;
|
||||
|
||||
if (BlurInvokers?.Count > 0)
|
||||
{
|
||||
foreach (var blurInvoker in BlurInvokers.ToArray())
|
||||
if (cConnectionStatusHelper.Instance?.ApiConnectionStatus == cConnectionStatusHelper.enumOnlineStatus.online)
|
||||
{
|
||||
if (blurInvoker is Window blurInvokerWindow)
|
||||
blurInvokerWindow.Hide();
|
||||
SearchBarUserControl.Visibility = Visibility.Collapsed;
|
||||
SearchBarUserControl.Clear();
|
||||
MenuBarUserControl.Visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
IsBlurred = BlurInvokers?.Count > 0;
|
||||
SearchResultBorder.Visibility = Visibility.Collapsed;
|
||||
|
||||
OverlayBorder.Child = null;
|
||||
OverlayBorder.Visibility = Visibility.Collapsed;
|
||||
|
||||
if (BlurInvokers?.Count > 0)
|
||||
{
|
||||
foreach (var blurInvoker in BlurInvokers.ToArray())
|
||||
{
|
||||
if (blurInvoker is Window blurInvokerWindow)
|
||||
blurInvokerWindow.Hide();
|
||||
}
|
||||
}
|
||||
|
||||
IsBlurred = BlurInvokers?.Count > 0;
|
||||
});
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
@@ -450,21 +560,8 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
{
|
||||
try
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
NavigationHeadingUc.IsHitTestVisible = false;
|
||||
NavigationHeadingUc.Opacity = 0.7;
|
||||
});
|
||||
|
||||
RefreshControl.IsDataIncomplete = true;
|
||||
|
||||
List<Task> tasks = new List<Task>
|
||||
{
|
||||
_supportCase?.SupportCaseDataProviderArtifact?.HealthCardDataHelper?.UpdateOnlineStatusAsync(),
|
||||
_supportCase?.SupportCaseDataProviderArtifact?.HealthCardDataHelper?.LoadingHelper?.RefreshLatestDataAsync()
|
||||
};
|
||||
|
||||
await Task.WhenAll(tasks);
|
||||
await _supportCaseController.RefreshDataForCurrentlyFocusedRelationAsync();
|
||||
RefreshControl.UpdateLastDataRequestTime();
|
||||
RefreshControl.IsDataIncomplete = false;
|
||||
}
|
||||
@@ -495,6 +592,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
{
|
||||
case cChangeHealthCardAction _:
|
||||
case cShowHeadingSelectionMenuAction _:
|
||||
case UiShowRawHealthcardValues _:
|
||||
break;
|
||||
case cUiQuickAction _:
|
||||
case cShowRecommendationAction _:
|
||||
@@ -515,7 +613,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
break;
|
||||
}
|
||||
|
||||
await e.UiAction.RunUiActionAsync(e.OriginalSource, drawingArea, true, _supportCase?.SupportCaseDataProviderArtifact);
|
||||
await e.UiAction.RunUiActionAsync(e.OriginalSource, drawingArea, true, _supportCaseController?.SupportCaseDataProviderArtifact);
|
||||
UpdateHistoryWidth();
|
||||
}
|
||||
catch (Exception E)
|
||||
@@ -545,21 +643,13 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
{
|
||||
try
|
||||
{
|
||||
if (isDataProviderLoading)
|
||||
return;
|
||||
|
||||
if (!(sender is FrameworkElement senderElement))
|
||||
return;
|
||||
|
||||
if (!(senderElement.Tag is enumFasdInformationClass informationClassTag))
|
||||
if (!(senderElement.Tag is cF4sdApiSearchResultRelation selectedRelation))
|
||||
return;
|
||||
|
||||
if (_supportCase?.SupportCaseDataProviderArtifact is null || !_supportCase.SupportCaseDataProviderArtifact.Identities.Any(identity => identity.Class == informationClassTag))
|
||||
return;
|
||||
|
||||
Mouse.OverrideCursor = Cursors.Wait;
|
||||
|
||||
await _supportCase?.SupportCaseDataProviderArtifact.ChangeHealthCardAsync(informationClassTag);
|
||||
_supportCaseController.UpdateFocusedCaseRelation(selectedRelation);
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
@@ -654,7 +744,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
private void F4SDIcon_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
CustomMessageBox.CustomMessageBox.Show("1. Have you tried turning it off and on again?\n2. Are you sure it is plugged in?", "How to solve (almost) any computer problem", enumHealthCardStateLevel.Info, this);
|
||||
_supportCase.SupportCaseDataProviderArtifact.HealthCardDataHelper.IsInEditMode = true;
|
||||
_supportCaseController.SupportCaseDataProviderArtifact.HealthCardDataHelper.IsInEditMode = true;
|
||||
}
|
||||
|
||||
#region CloseCaseWithTicketIcon_Click
|
||||
@@ -701,17 +791,14 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!(e.NewValue is bool isVisible))
|
||||
if (!(e.NewValue is bool isVisible && isVisible))
|
||||
return;
|
||||
|
||||
if (isVisible)
|
||||
{
|
||||
Show();
|
||||
Activate();
|
||||
Focus();
|
||||
if (IsWindowLoaded)
|
||||
WindowState = WindowState.Maximized;
|
||||
}
|
||||
Show();
|
||||
Activate();
|
||||
Focus();
|
||||
if (IsWindowLoaded)
|
||||
WindowState = WindowState.Maximized;
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
@@ -936,7 +1023,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
LogMethodBegin(CM);
|
||||
try
|
||||
{
|
||||
LogEntry($"DataChanged - DataProvider for Class: {_supportCase?.SupportCaseDataProviderArtifact.Identities[0].Class} - Id: {_supportCase?.SupportCaseDataProviderArtifact.Identities[0].Id}");
|
||||
LogEntry($"DataChanged - DataProvider for Class: {_supportCaseController?.SupportCaseDataProviderArtifact.Identities[0].Class} - Id: {_supportCaseController?.SupportCaseDataProviderArtifact.Identities[0].Id}");
|
||||
|
||||
if (isDataChangedEventRunning)
|
||||
{
|
||||
@@ -949,21 +1036,6 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
|
||||
if (!(e is BooleanEventArgs booleanArg) || booleanArg.BooleanArg == false)
|
||||
isDataProviderLoading = true;
|
||||
var data = _supportCase?.SupportCaseDataProviderArtifact.HealthCardDataHelper.DetailPage.GetDataWithoutHeading();
|
||||
await Dispatcher.Invoke(async () =>
|
||||
{
|
||||
NavigationHeadingUc.HeadingData = _supportCase?.SupportCaseDataProviderArtifact.HealthCardDataHelper.GetHeadingDataWithoutOnlineStatus();
|
||||
NavigationHeadingUc.HeadingData = await _supportCase?.SupportCaseDataProviderArtifact.HealthCardDataHelper.UpdateOnlineStatusAsync();
|
||||
});
|
||||
Dispatcher.Invoke(() => { WidgetCollection.UpdateWidgetData(data.WidgetData); });
|
||||
Dispatcher.Invoke(() => DataHistoryCollectionUserControl.UpdateHistory(data.DataHistoryList));
|
||||
Dispatcher.Invoke(() => CustomizableSectionUc.UpdateContainerCollection(data.DataContainerCollectionList));
|
||||
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
if (DataContext is DetailsPageViewModel viewModel)
|
||||
viewModel.SetPropertyValues(data);
|
||||
});
|
||||
|
||||
Dispatcher.Invoke(UpdateHistoryWidth);
|
||||
|
||||
@@ -1023,7 +1095,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
bool hasDirectConnection = _supportCase?.SupportCaseDataProviderArtifact?.DirectConnectionHelper?.IsDirectConnectionActive ?? false;
|
||||
bool hasDirectConnection = _supportCaseController?.SupportCaseDataProviderArtifact?.DirectConnectionHelper?.IsDirectConnectionActive ?? false;
|
||||
NavigationHeadingUc.HasDirectConnection = hasDirectConnection;
|
||||
|
||||
if (hasDirectConnection)
|
||||
@@ -1295,7 +1367,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
|
||||
private void ChangeNotepadNotification()
|
||||
{
|
||||
FlowDocument document = _supportCase?.SupportCaseDataProviderArtifact.CaseNotes;
|
||||
FlowDocument document = _supportCaseController?.SupportCaseDataProviderArtifact.CaseNotes;
|
||||
bool isFlowDocumentEmpty = !document.Blocks.Any(block =>
|
||||
{
|
||||
if (block is Paragraph paragraph)
|
||||
@@ -1358,22 +1430,16 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
BlurBorder_Click();
|
||||
MenuBarUserControl.Visibility = Visibility.Visible;
|
||||
SearchBarUserControl.Visibility = Visibility.Collapsed;
|
||||
|
||||
QuickActionSelectorUc.QuickActionList = null;
|
||||
QuickActionSelectorUc.Visibility = Visibility.Collapsed;
|
||||
QuickActionDecorator.Child.Visibility = Visibility.Collapsed;
|
||||
|
||||
NotepadDecorator.Visibility = Visibility.Collapsed;
|
||||
NotepadDecorator.Child = null;
|
||||
notepad = null;
|
||||
|
||||
isQuickActionDecoratorVisible = false;
|
||||
|
||||
isQuickActionSelectorVisible = false;
|
||||
|
||||
if (IsLoaded)
|
||||
ReinitializeNotepad();
|
||||
|
||||
DataHistoryCollectionUserControl.ToggleVerticalCollapseDetails(true);
|
||||
UpdateHistoryWidth();
|
||||
}
|
||||
@@ -1383,64 +1449,6 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
}
|
||||
}
|
||||
|
||||
public void SetPropertyValues(cDetailsPageData detailPageData)
|
||||
{
|
||||
var CM = MethodBase.GetCurrentMethod();
|
||||
LogMethodBegin(CM);
|
||||
try
|
||||
{
|
||||
if (DataContext is DetailsPageViewModel viewModel)
|
||||
{
|
||||
viewModel.SetPropertyValues(detailPageData);
|
||||
|
||||
NavigationHeadingUc.HeadingData = detailPageData.HeadingData;
|
||||
|
||||
ResetPageToDefaultState();
|
||||
|
||||
if (detailPageData.DataHistoryList?.Count > 0)
|
||||
{
|
||||
CustomizableSectionUc.Visibility = Visibility.Collapsed;
|
||||
DataHistoryCollectionUserControl.Visibility = Visibility.Visible;
|
||||
DataHistoryCollectionUserControl.HistoryDataList = detailPageData.DataHistoryList;
|
||||
DataHistoryCollectionUserControl.DataProvider = _supportCase?.SupportCaseDataProviderArtifact;
|
||||
|
||||
QuickActionSelectorUc.IsLocked = cFasdCockpitConfig.Instance.IsHistoryQuickActionSelectorVisible;
|
||||
|
||||
if (cFasdCockpitConfig.Instance.IsHistoryQuickActionSelectorVisible)
|
||||
MoreButtonClickedAction();
|
||||
}
|
||||
else if (detailPageData.DataContainerCollectionList?.Count > 0)
|
||||
{
|
||||
DataHistoryCollectionUserControl.Visibility = Visibility.Collapsed;
|
||||
CustomizableSectionUc.Visibility = Visibility.Visible;
|
||||
CustomizableSectionUc.ContainerCollections = detailPageData.DataContainerCollectionList;
|
||||
|
||||
var ticketMenuData = detailPageData.MenuBarData.FirstOrDefault(menuData => menuData.MenuText == "Ticket");
|
||||
|
||||
if (ticketMenuData != null)
|
||||
if (ticketMenuData is cMenuDataContainer containerMenuData)
|
||||
{
|
||||
QuickActionSelectorUc.QuickActionSelectorHeading = containerMenuData.MenuText;
|
||||
QuickActionSelectorUc.QuickActionList = containerMenuData.SubMenuData;
|
||||
}
|
||||
|
||||
QuickActionSelectorUc.IsLocked = cFasdCockpitConfig.Instance.IsCustomizableQuickActionSelectorVisible;
|
||||
|
||||
if (cFasdCockpitConfig.Instance.IsCustomizableQuickActionSelectorVisible)
|
||||
QuickActionSelectorUc.Visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
finally
|
||||
{
|
||||
LogMethodEnd(CM);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region DataHistoryCollection
|
||||
@@ -1589,9 +1597,9 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
|
||||
try
|
||||
{
|
||||
midnightTimer.Stop();
|
||||
_midnightTimer.Stop();
|
||||
|
||||
var from = _supportCase?.SupportCaseDataProviderArtifact?.HealthCardDataHelper?.LoadingHelper?.LastDataRequest;
|
||||
var from = _supportCaseController?.SupportCaseDataProviderArtifact?.HealthCardDataHelper?.LoadingHelper?.LastDataRequest;
|
||||
|
||||
if (from == null)
|
||||
{
|
||||
@@ -1618,7 +1626,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
||||
}
|
||||
finally
|
||||
{
|
||||
midnightTimer.Start();
|
||||
_midnightTimer.Start();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
|
||||
using FasdDesktopUi.Basics.Models;
|
||||
using FasdDesktopUi.Pages.DetailsPage.Models;
|
||||
using FasdDesktopUi.Basics;
|
||||
|
||||
using static C4IT.Logging.cLogManager;
|
||||
|
||||
namespace FasdDesktopUi.Pages.DetailsPage.ViewModels
|
||||
@@ -48,56 +39,6 @@ namespace FasdDesktopUi.Pages.DetailsPage.ViewModels
|
||||
|
||||
#endregion
|
||||
|
||||
#region Header Properties
|
||||
|
||||
#region PageTitle Property
|
||||
|
||||
private string pageTitle;
|
||||
public string PageTitle
|
||||
{
|
||||
get { return pageTitle; }
|
||||
set
|
||||
{
|
||||
pageTitle = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region HeadingData Property
|
||||
|
||||
private List<cHeadingDataModel> headingData;
|
||||
|
||||
public List<cHeadingDataModel> HeadingData
|
||||
{
|
||||
get { return headingData; }
|
||||
set
|
||||
{
|
||||
headingData = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Widget Properties
|
||||
|
||||
#region WidgetData Property
|
||||
private List<List<cWidgetValueModel>> widgetDataList;
|
||||
public List<List<cWidgetValueModel>> WidgetDataList
|
||||
{
|
||||
get { return widgetDataList; }
|
||||
set
|
||||
{
|
||||
widgetDataList = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region WidgetGeometry Property
|
||||
private List<DetailsPageWidgetGeometryModel> widgetGeometryList;
|
||||
public List<DetailsPageWidgetGeometryModel> WidgetGeometryList
|
||||
@@ -112,8 +53,6 @@ namespace FasdDesktopUi.Pages.DetailsPage.ViewModels
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Details Properties
|
||||
|
||||
#region TimeSinceLastRefresh property
|
||||
@@ -145,21 +84,6 @@ namespace FasdDesktopUi.Pages.DetailsPage.ViewModels
|
||||
|
||||
#endregion
|
||||
|
||||
#region DetailsData property
|
||||
|
||||
private cDetailsPageDataHistoryDataModel detailsDataList;
|
||||
public cDetailsPageDataHistoryDataModel DetailsDataList
|
||||
{
|
||||
get { return detailsDataList; }
|
||||
set
|
||||
{
|
||||
detailsDataList = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ShownValueColumnsCount
|
||||
public int ShownValueColumnsCount
|
||||
{
|
||||
@@ -245,39 +169,6 @@ namespace FasdDesktopUi.Pages.DetailsPage.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public void SetPropertyValues(cDetailsPageData propertyValues)
|
||||
{
|
||||
var CM = MethodBase.GetCurrentMethod();
|
||||
LogMethodBegin(CM);
|
||||
try
|
||||
{
|
||||
DataProvider = propertyValues.DataProvider;
|
||||
|
||||
//Heading Properties
|
||||
HeadingData = propertyValues.HeadingData;
|
||||
|
||||
//Widget Properties
|
||||
WidgetDataList = propertyValues.WidgetData;
|
||||
|
||||
//Details Properties
|
||||
TimeSinceLastRefresh = propertyValues.TimeSinceLastRefresh;
|
||||
ShownValueColumnsCount = propertyValues.ShownValueColumnsCount;
|
||||
DetailsDataList = propertyValues.DataHistoryList;
|
||||
|
||||
//Menu Properties
|
||||
MenuBarData = propertyValues.MenuBarData;
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogEntry($"Passed history values: {propertyValues}");
|
||||
LogException(E);
|
||||
}
|
||||
finally
|
||||
{
|
||||
LogMethodEnd(CM);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:FasdDesktopUi.Pages.DetailsPage.UserControls"
|
||||
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon"
|
||||
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||
xmlns:config="clr-namespace:C4IT.FASD.Base;assembly=F4SD-Cockpit-Client-Base"
|
||||
xmlns:vc="clr-namespace:FasdDesktopUi.Basics.Converter"
|
||||
mc:Ignorable="d"
|
||||
|
||||
@@ -1,21 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using C4IT.Logging;
|
||||
using C4IT.MultiLanguage;
|
||||
using FasdDesktopUi.Basics;
|
||||
using FasdDesktopUi.Basics.Enums;
|
||||
using FasdDesktopUi.Pages.DetailsPage.Models;
|
||||
@@ -509,7 +503,7 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||
default:
|
||||
subtitleStyle = titleColumnMainTitleStyle;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
double subtitleLength = MeasureStringSize(subtitle.Content, new TextBox { Style = subtitleStyle }).Width;
|
||||
maxTitleLength = maxTitleLength < subtitleLength ? subtitleLength + 70 : maxTitleLength;
|
||||
|
||||
@@ -19,6 +19,7 @@ using C4IT.FASD.Base;
|
||||
|
||||
using static C4IT.Logging.cLogManager;
|
||||
using C4IT.FASD.Cockpit.Communication;
|
||||
using FasdDesktopUi.Basics.Services.SupportCase.Controllers;
|
||||
|
||||
namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||
{
|
||||
@@ -41,6 +42,8 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||
}
|
||||
}
|
||||
|
||||
public SupportCaseController SupportCaseController { get; set; }
|
||||
|
||||
private List<Border> _highlightBorders;
|
||||
|
||||
private void UpdateHeaderHighlights()
|
||||
@@ -457,6 +460,8 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||
|
||||
if (headingIcon != null)
|
||||
{
|
||||
headingIcon.Tag = heading.Realtion;
|
||||
|
||||
if (heading.IsOnline)
|
||||
{
|
||||
headingIcon.SetResourceReference(AdaptableIcon.PrimaryIconColorProperty, "Color.Green");
|
||||
@@ -471,6 +476,7 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||
|
||||
if (headingTextBlock != null && string.IsNullOrWhiteSpace(heading.HeadingText) is false)
|
||||
{
|
||||
headingTextBlock.Tag = heading.Realtion;
|
||||
headingTextBlock.Text = heading.HeadingText;
|
||||
}
|
||||
|
||||
@@ -632,7 +638,7 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||
var action = new cShowHeadingSelectionMenuAction();
|
||||
ShowsRelations = true;
|
||||
cUiActionBase.RaiseEvent(new cShowHeadingSelectionMenuAction(), this, sender);
|
||||
DoShowRelations(swapCaseData, location);
|
||||
DoShowRelations(swapCaseData, location, SupportCaseController);
|
||||
//Dispatcher.Invoke(async () => await action.RunUiActionAsync(sender, location, false, DataProvider));
|
||||
}
|
||||
catch (Exception E)
|
||||
@@ -642,7 +648,7 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||
}
|
||||
|
||||
|
||||
private void DoShowRelations(cSwapCaseInfo swapCaseData, CustomMenu customMenu)
|
||||
private void DoShowRelations(cSwapCaseInfo swapCaseData, CustomMenu customMenu, SupportCaseController supportCaseController)
|
||||
{
|
||||
|
||||
var CM = MethodBase.GetCurrentMethod();
|
||||
@@ -669,7 +675,7 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||
{
|
||||
IsMatchingRelation = isMatchingRelation,
|
||||
IsUsedForCaseEnrichment = true,
|
||||
UiAction = new cChangeHealthCardAction(storedRelation)
|
||||
UiAction = new cChangeHealthCardAction(storedRelation, supportCaseController)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:FasdDesktopUi.Pages.DetailsPage.UserControls"
|
||||
xmlns:uc="clr-namespace:FasdDesktopUi.Pages.DetailsPage.UserControls"
|
||||
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon"
|
||||
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||
xmlns:config="clr-namespace:C4IT.FASD.Base;assembly=F4SD-Cockpit-Client-Base"
|
||||
x:Name="_this"
|
||||
mc:Ignorable="d"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
d:Background="White"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}" Loaded="UserControl_Loaded">
|
||||
|
||||
<UserControl.Resources>
|
||||
<vc:LanguageDefinitionsConverter x:Key="LanguageConverter" />
|
||||
@@ -50,6 +50,15 @@
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
|
||||
<ico:AdaptableIcon x:Name="RawValuesButton"
|
||||
Margin="7.5 0 0 0"
|
||||
Visibility="Collapsed"
|
||||
ToolTip="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Global.NavBar.ShowRawValues}"
|
||||
SelectedMaterialIcon="ic_view_list"
|
||||
MouseUp="RawValuesButton_Click"
|
||||
TouchDown="RawValuesButton_Click"
|
||||
/>
|
||||
|
||||
<ico:AdaptableIcon x:Name="MinimizeButton"
|
||||
BorderPadding="0 10 0 0"
|
||||
VerticalAlignment="Bottom"
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
using System.Windows;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
using FasdDesktopUi.Basics.UiActions;
|
||||
|
||||
namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||
{
|
||||
public partial class DetailsPageWindowStateBar : UserControl
|
||||
@@ -11,6 +14,14 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (cFasdCockpitConfig.Instance?.ShowRawHealthcardValues == true)
|
||||
RawValuesButton.Visibility = Visibility.Visible;
|
||||
else
|
||||
RawValuesButton.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
private void MinimizeButton_Click(object sender, InputEventArgs e)
|
||||
{
|
||||
if (sender is UIElement senderVisual)
|
||||
@@ -28,5 +39,11 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||
if (sender is UIElement senderVisual)
|
||||
Window.GetWindow(senderVisual).Close();
|
||||
}
|
||||
|
||||
private void RawValuesButton_Click(object sender, InputEventArgs e)
|
||||
{
|
||||
cUiActionBase.RaiseEvent(new UiShowRawHealthcardValues(), this, this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user