Also using a link label style to allow to move overview grid by clicking on the element
39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
// Copyright (c) 2024- schick Informatik
|
|
// Description: display single history element (later shown in a list)
|
|
//
|
|
|
|
using BreCalClient.misc.Model;
|
|
using System;
|
|
using System.Windows.Controls;
|
|
|
|
namespace BreCalClient
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for HistoryControl.xaml
|
|
/// </summary>
|
|
public partial class HistoryControl : UserControl
|
|
{
|
|
private readonly History _history;
|
|
public event Action<int>? HistorySelected;
|
|
|
|
public HistoryControl(string ship, History history, string callType, string etaetd)
|
|
{
|
|
InitializeComponent();
|
|
_history = history;
|
|
this.textBlockOperation.Text = $"{history.Operation} on {history.Type}";
|
|
this.hyperLinkShip.Text = ship;
|
|
|
|
if(BreCalLists.ParticipantLookupDict.ContainsKey(history.ParticipantId))
|
|
this.textBlockParticipant.Text = BreCalLists.ParticipantLookupDict[history.ParticipantId].Name;
|
|
this.textBlockTimestamp.Text = history.Timestamp.ToString();
|
|
this.textBlockEta.Text = etaetd;
|
|
this.textBlockShipcallType.Text = callType;
|
|
}
|
|
|
|
private void textBlockShip_Click(object sender, System.Windows.RoutedEventArgs e)
|
|
{
|
|
this.HistorySelected?.Invoke(_history.ShipcallId);
|
|
}
|
|
}
|
|
}
|