public SendMessage(BaseMessage message) { InitializeComponent(); if (message.Text != null) { MessageText.Text = GlobalBase.Base64Decode(message.Text); } SendTime.Text = message.DateOfSending.ToString("hh:mm"); ButtonDwnld.Visibility = message.ChatFileId != 0 ? Visibility.Visible : Visibility.Collapsed; DataContext = new MessageControlVM(message); }
public ReceiveMessage(BaseMessage message) { InitializeComponent(); if (message.Text != null) { MessageText.Text = GlobalBase.Base64Decode(message.Text); } SendTime.Text = message.DateOfSending.ToString("hh:mm"); ButtonDwnld.Visibility = message.ChatFileId != 0 ? Visibility.Visible : Visibility.Collapsed; if (message is GroupMessage mes) { SenderName.Visibility = Visibility.Visible; SenderName.Text = mes.SenderName; } else { SenderName.Visibility = Visibility.Collapsed; } DataContext = new MessageControlVM(message); }