コード例 #1
0
ファイル: SendMessage.xaml.cs プロジェクト: poorTiK/Message
        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);
        }
コード例 #2
0
        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);
        }