// Copyright (c) 2023 schick Informatik // Description: Show general shipcall info // using System; using System.Windows; using System.Windows.Controls; namespace BreCalClient { /// /// Interaction logic for ShipcallControl.xaml /// public partial class ShipcallControl : UserControl { #region Construction public ShipcallControl() { InitializeComponent(); } #endregion #region events public event Action? EditRequested; public event Action? TimesRequested; public event Action? OpenExtraRequested; #endregion #region Properties /// /// this is our datasource /// public ShipcallControlModel? ShipcallControlModel { get; set; } #endregion #region event handler private void UserControl_Loaded(object sender, RoutedEventArgs e) { this.DataContext = this.ShipcallControlModel; if (this.ShipcallControlModel == null) return; this.labelAgent.Content = this.ShipcallControlModel.AssignedParticipants.ContainsKey(8) ? this.ShipcallControlModel.AssignedParticipants[8].Name : string.Empty; this.labelMooring.Content = this.ShipcallControlModel.AssignedParticipants.ContainsKey(16) ? this.ShipcallControlModel.AssignedParticipants[16].Name : string.Empty; } private void buttonListTimes_Click(object sender, RoutedEventArgs e) { if(this.TimesRequested != null) { this.TimesRequested(this); } } private void buttonEditShipcall_Click(object sender, RoutedEventArgs e) { if (this.EditRequested != null) { this.EditRequested(this); } } private void buttonOpenDropDown_Click(object sender, RoutedEventArgs e) { if(this.OpenExtraRequested != null) { this.OpenExtraRequested(this); } } #endregion } } /* * Description("not assigned")] NONE = 0, [Description("BSMD")] BSMD = 1, [Description("Terminal")] TERMINAL = 2, [Description("Lotsen")] PILOT = 4, [Description("Agentur")] AGENCY = 8, [Description("Festmacher")] MOORING = 16, [Description("Hafenamt")] PORT_ADMINISTRATION = 32, [Description("Schlepper")] TUG = 64,*/