initial
This commit is contained in:
179
UserControls/IncidentListItem.xaml.cs
Normal file
179
UserControls/IncidentListItem.xaml.cs
Normal file
@@ -0,0 +1,179 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
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.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using C4IT.API.Contracts;
|
||||
using C4IT_CustomerPanel.libs;
|
||||
|
||||
namespace C4IT_CustomerPanel.UserControls
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für IncidentListItem.xaml
|
||||
/// </summary>
|
||||
public partial class IncidentListItem : UserControl, INotifyPropertyChanged
|
||||
{
|
||||
|
||||
private Ticket _ticketItem;
|
||||
public Ticket TicketItem
|
||||
{
|
||||
get => _ticketItem;
|
||||
set
|
||||
{
|
||||
_ticketItem = value;
|
||||
OnPropertyChanged(nameof(TicketItem));
|
||||
OnPropertyChanged(nameof(Subject));
|
||||
OnPropertyChanged(nameof(TicketNumber));
|
||||
OnPropertyChanged(nameof(LastJournalEntryActionText));
|
||||
OnPropertyChanged(nameof(CreatedDate));
|
||||
OnPropertyChanged(nameof(IsUnread));
|
||||
OnPropertyChanged(nameof(State));
|
||||
OnPropertyChanged(nameof(StateValue));
|
||||
OnPropertyChanged(nameof(TicketType));
|
||||
}
|
||||
}
|
||||
|
||||
public string LastJournalEntryActionText
|
||||
{
|
||||
get { return _ticketItem._lastJournalEntryActionText; }
|
||||
set
|
||||
{
|
||||
_ticketItem._lastJournalEntryActionText = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private Boolean _isUnread;
|
||||
public Boolean IsUnread
|
||||
{
|
||||
get { return _isUnread; }
|
||||
set
|
||||
{
|
||||
_isUnread = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
public DateTime CreatedDate
|
||||
{
|
||||
get { return _ticketItem._createdDate.ToLocalTime(); }
|
||||
set
|
||||
{
|
||||
_ticketItem._createdDate = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string TicketNumber
|
||||
{
|
||||
get { return _ticketItem._ticketNumber; }
|
||||
set
|
||||
{
|
||||
_ticketItem._ticketNumber = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string Subject
|
||||
{
|
||||
get { return _ticketItem._subject; }
|
||||
set
|
||||
{
|
||||
_ticketItem._subject = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
public int StateValue
|
||||
{
|
||||
get { return _ticketItem._stateValue; }
|
||||
set
|
||||
{
|
||||
_ticketItem._stateValue = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
public string State
|
||||
{
|
||||
get { return _ticketItem._state; }
|
||||
set
|
||||
{
|
||||
_ticketItem._state = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string TicketType
|
||||
{
|
||||
get { return _ticketItem._ticketType; }
|
||||
set
|
||||
{
|
||||
_ticketItem._ticketType = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Guid getEOID()
|
||||
{
|
||||
return _ticketItem._objectID;
|
||||
}
|
||||
#region INotifyPropertyChanged Members
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Raises this object's PropertyChanged event.
|
||||
/// </summary>
|
||||
/// <param name="propertyName">The property that has a new value.</param>
|
||||
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChangedEventHandler handler = this.PropertyChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
var e = new PropertyChangedEventArgs(propertyName);
|
||||
handler(this, e);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
public IncidentListItem(Ticket ticket)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = this;
|
||||
TicketItem = ticket;
|
||||
}
|
||||
|
||||
private void orderBy_PreviewMouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
TextBlock tb = (TextBlock)sender;
|
||||
|
||||
var k = Window.GetWindow(this) as MainWindow;
|
||||
|
||||
k.ReorderTicketCollection((MainWindow.enumOrderBy)Enum.ToObject(typeof(MainWindow.enumOrderBy), Int32.Parse(tb.Tag.ToString())));
|
||||
|
||||
}
|
||||
|
||||
private void OnIncidentMouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
HighlightIncidentBorder.BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#2d45fb"));
|
||||
}
|
||||
|
||||
private void OnIncidentMouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
HighlightIncidentBorder.BorderBrush = new SolidColorBrush(Colors.White);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user