예제 #1
0
        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");
        }
예제 #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();
        }
예제 #3
0
 private void closeButton_Click(object sender, RoutedEventArgs e)
 {
     SocketConnection.GetInstance().DisConnect();
     App.Current.Shutdown();
 }
예제 #4
0
 private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     SocketConnection.GetInstance().DisConnect();
     App.Current.Shutdown();
 }