public HomeViewModel()
        {
            homeModel          = new HomeModel();
            chatCommand        = new RelayCommand(chatExecuteMethod);
            findUserCommand    = new RelayCommand(findUserExecuteMethod);
            setProfileCommand  = new RelayCommand(setProfileExecuteMethod);
            viewProfileCommand = new RelayCommand(viewProfileExecuteMethod);
            addChatCommand     = new RelayCommand(addChatExecuteMethod);
            refreshCommand     = new RelayCommand(refreshExecuteMethod);

            homeModel.changed += OnPropertyUpdate;

            SocketConnection.GetInstance().Send("Success", "null");
        }
Beispiel #2
0
        // 초기화
        public void Init(string userId, string roomName, string showedRoomName, Dictionary <string, ImageSource> friendsImage)
        {
            AttachSocket();
            this.roomName       = roomName;
            this.showedRoomName = showedRoomName;
            this.userId         = userId;
            this.friendsImage   = friendsImage;


            SocketConnection.GetInstance().Send("Room", roomName);

            roomView              = new ChatRoomView();
            roomView.DataContext  = this;
            this.scroll           = roomView.scrollView;
            roomView.endOfScroll += scrollEnd;

            roomView.Show();
        }
 private void closeButton_Click(object sender, RoutedEventArgs e)
 {
     SocketConnection.GetInstance().DisConnect();
     App.Current.Shutdown();
 }
 private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     SocketConnection.GetInstance().DisConnect();
     App.Current.Shutdown();
 }