コード例 #1
0
        public ChatFrame(string LoginFirst, string LoginSecond)
        {
            InitializeComponent();
            _LoginFirst  = LoginFirst;
            _LoginSecond = LoginSecond;


            client = new ServiceChatClient(new System.ServiceModel.InstanceContext(this));
            client.Connect(LoginFirst);
            client.CreateConversation(LoginFirst, LoginSecond);
            ChatUsers.Content = "чат с " + LoginSecond;
            List <string> ChatAllMessage = client.GetAllMessage(LoginFirst, LoginSecond).ToList();

            foreach (string message in ChatAllMessage)
            {
                GetMessage.Items.Add(message);
                GetMessage.ScrollIntoView(GetMessage.Items[GetMessage.Items.Count - 1]);
            }
        }