private void ButtonOK_Click(object sender, RoutedEventArgs e)
 {
     if (TextBoxChannelName.Text != "")
     {
         RequestCreateChannel?.Invoke(this, new RequestCreateChannelArgs(TextBoxChannelName.Text));
     }
 }
 public ResponseCreateChannel CreateChannel(RequestCreateChannel r)
 {
     try
     {
         var users    = _userRepository.GetById(r.userIds);
         var channel  = _channelRepository.Create(users, r.channelname);
         var channels = _channelRepository.GetUserChannels(r.UserId);
         if (channel != null)
         {
             return(new ResponseCreateChannel()
             {
                 message = $"Chanel \"{r.channelname}\" been created succesfully",
                 status = ResponseStatus.Success,
                 channels = channels
             });
         }
         return(new ResponseCreateChannel()
         {
             message = $"Chanel \"{r.channelname}\" cannot be created due to unknown problem.",
             status = ResponseStatus.Error
         });
     }
     catch (Exception ex)
     {
         return(new ResponseCreateChannel()
         {
             message = $"Chanel \"{r.channelname}\" cannot be created.",
             exception = ex,
             status = ResponseStatus.Error
         });
     }
 }