public PrivateMessagesListUserControl(WebSocketsMessageSender webSocketsMessageSender,
                                       ChatGlobals chatGlobals)
 {
     _webSocketsMessageSender = webSocketsMessageSender;
     _chatGlobals             = chatGlobals;
     InitializeComponent();
 }
 public SendMessageUserControlViewModel(WebSocketsMessageSender isender)//Constructor
 {
     _sender            = isender;
     SendMessageCommand = new DelegateCommand(SendMessage);
     this.IntializeCommands();
     _sender._ChatGlobals.CurrentChatSelected += OnUserPickedMessanger;
 }
 public PrivateMessagesListUserControlViewModel(WebSocketsMessageHandler ihandler, WebSocketsMessageSender isender)
 {
     _handler = ihandler;
     _sender  = isender;
     _sender.CreatePrivateMessageOutcoming += OnCreatePrivateMessageOutcoming;
     _handler.PrivateMessagesRecieved      += OnPrivateMessagesRecieved;
     _handler.PrivateMessageRecieved       += OnPrivateMessageRecieved;
     //=================================================================================
     _sender.CreateChatMessageOutcoming        += OnCreateChatMessageOutcoming;
     _handler.ChatMessageRecieved              += OnChatMessageRecieved;
     _handler.ChatMessagesRecieved             += OnChatMessagesRecieved;
     _handler._ChatGlobals.CurrentChatSelected += OnCurrentChatSelected;
     _sender.GotAllChatMessages   += OnGotAllChatMessages;
     _sender.GotAllFriendMessages += OnGotAllFriendMessages;
 }
Пример #4
0
        public ModuleAPopupViewModel(WebSocketsMessageHandler ihandler, WebSocketsMessageSender isender)
        {
            SelectionChangedCommand = new DelegateCommand(ChatSelected);
            InviteSelectedFriendsToChatAsyncCommand = new DelegateCommand(InviteSelectedFriendsToChatAsync);
            _sender  = isender;
            _handler = ihandler;

            var chatsCollection = new ObservableCollection <Chat>();

            chatsCollection.AddRange(_handler._ChatsManager.GetAll());
            Chats = chatsCollection;

            var friendsCollection = new ObservableCollection <User>();

            friendsCollection.AddRange(_handler._FriendsManager.GetAll());
            Friends = friendsCollection;
        }
Пример #5
0
        public MainMenuUserControlViewModel(WebSocketsMessageHandler ihandler,
                                            WebSocketsMessageSender isender,
                                            WebApiClient webApiClient)
        {
            ModernDialog.ShowMessage("SomeText,", "Title", MessageBoxButton.OK);
            _sender       = isender;
            _handler      = ihandler;
            _webApiClient = webApiClient;

            // _sender.CreateMessageOutcomingEventHandler += OnCreateMessageOutcomingEventHandler;
            //_handler.InitialInfoRecieved += OnInitialInfoRecieved;


            PrivateMessages = new ObservableCollection <PrivateMessage>
            {
                new PrivateMessage
                {
                    Content = new MessageContent {
                        Date = DateTime.Now, Id = 1, Text = "Message messasge message"
                    },
                    Incoming = true,
                    IsNew    = false
                },
                new PrivateMessage
                {
                    Content = new MessageContent {
                        Date = DateTime.Now, Id = 1, Text = "Message messasge message"
                    },
                    Incoming = false,
                    IsNew    = false
                },
                new PrivateMessage
                {
                    Content = new MessageContent {
                        Date = DateTime.Now, Id = 1, Text = "Message messasge message"
                    },
                    Incoming = true,
                    IsNew    = false
                },
                new PrivateMessage
                {
                    Content = new MessageContent {
                        Date = DateTime.Now, Id = 1, Text = "Message messasge message"
                    },
                    Incoming = false,
                    IsNew    = false
                },
                new PrivateMessage
                {
                    Content = new MessageContent {
                        Date = DateTime.Now, Id = 1, Text = "Message messasge message"
                    },
                    Incoming = true,
                    IsNew    = false
                },
            };
            //_sender = isender;
            // _handler = ihandler;
            //_webApiClient = webApiClient;

            //PostLogOutCommand = new DelegateCommand(PostLogOutAsync);
            //IsUserSignedInCommand = new DelegateCommand(IsUserSignedInAsync);
            //SearchFriendAsyncCommand = new DelegateCommand(SearchFriendAsync);
            //CreateChatAsyncCommand = new DelegateCommand(CreateChatAsync);
            //SendMessageCommand = new DelegateCommand(SendMessage);
            //InviteToChatAsyncCommand = new DelegateCommand(InviteToChatAsync);
            //LoadAndShowFriendsCommand = new DelegateCommand(LoadAndShowFriends);
            // LoadAndShowChatsCommand = new DelegateCommand(LoadAndShowChats);
            //LoadAndShowPrivateMessagesCommand = new DelegateCommand(LoadAndShowPrivateMessages);
            // LoadAndShowChatMessagesCommand = new DelegateCommand(LoadAndShowChatMessages);
            //FriendSelectedCommand = new DelegateCommand<User>(FriendSelected);
            // ChatSelectedCommand = new DelegateCommand<Chat>(ChatSelected);
            //_handler.InitialInfoRecieved += OnInitialInfoRecieved;
            // _handler.ErrorMessageRecieved += OnErrorMessageRecieved;
            // _handler.UserFoundRecieved += OnUserFoundRecieved;
            // _handler.FriendConfirmedRecieved += OnFriendConfirmedRecieved;
            //_handler.ConnectionStatusRecieved += OnConnectionStatusRecieved;
            // _handler.PrivateMessageRecieved += OnPrivateMessageRecieved;
            // _handler.ChatMessageRecieved += OnChatMessageRecieved;
            //_handler.ChatCreatedRecieved += OnChatCreatedRecieved;
            //_handler.ChatConfirmedRecieved += OnChatConfirmedRecieved;
            //_handler.FriendRequestRecieved += OnFriendRequestRecieved;
            //_handler.ChatRequestRecieved += OnChatRequestRecieved;
            //_handler.PrivateMessagesRecieved += OnPrivateMessagesRecieved;
            // _handler.ChatMessagesRecieved += OnChatMessagesRecieved;
        }