Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9000251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:17:16+00:00 2026-06-16T00:17:16+00:00

I am creating a chat application that will also have the ability for file

  • 0

I am creating a chat application that will also have the ability for file transfer. I am trying to design it with the MVVM pattern utilizing Prism.

My model for this application, or at least this one module(the application only has one module at this time, and it might be the only module), is a ChatManager class that is responsible for hosting servers, joining servers and holding all the state information of the chat sessions. It might be a client that is connecting to another server, or it might be both a client and a server as any individual who hosts a chat will also be a client to his own server.

In my application I have different views and viewmodels for each of the different areas of the program, the message area, the area that has the user list, and the area where users type their messages. The views know nothing about the viewmodels, and the viewmodels know nothing about the views. The viewmodels are very simplistic and contain nearly no logic.

All the logic resides in my ChatController class which basically controls the flow of the application. It is responsible for creating all of the views, all of the models, assigning the proper viewmodels as the datacontexts of the views, and injecting each of the views into the shell at the appropriate time. It also has the responsibility of assigning the actual data to the viewmodels, from the model.

The problem I’m having is how to cleanly keep the viewmodel ObservableCollections up to date with the Lists contained within the model. For example, in the model I have a list of connected users. Whenever that list changes, such as when a user connects or disconnects, I need to update the ObservableCollection of users in the viewmodel that handles the user list.

The way I’m thinking I need to accomplish this is using events. So I’ve created events that are fired in the model whenever a user connects, whenever a user disconnects. Surely I must have events as well for when the server is sending out a message to all of the users and all the other things the model actually does.

I guess my question is, is this a good way of doing it? Should I instead change the model’s user collection to be an ObservableCollection and avoid the events altogether, simply assigning the viewmodel’s collection to the model collection?

The more I try to structure this application, the more confusing it becomes for me. Right now my controller is quite large in the number of methods it has and I haven’t even begun to add all the features of the chat program that I want to.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:17:17+00:00Added an answer on June 16, 2026 at 12:17 am

    I think the whole question’s redundant because of the last but one paragraph 🙂

    ObservableCollection is part of System.Collections.ObjectModel. It’s nothing to do with any particular UI technology so I don’t see any need to keep it confined to the view model rather than having it up in the core and replacing your Lists.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 questions for you. Im creating an Application for Chat that relies
I am creating a chat application. In this chat application, I have to use
I am creating a chat application using JApplet . I have a TextArea where
I'm creating a chat widget that will be dropped into CommunityServer. The widget works
I am creating chat application and in that I don't know how to create
I am looking into creating a real-time document editing and chat application. I have
I am creating a chat application using Node.js, and would like to have a
I am creating a chat application which supports chat, group chat, file sharing, whiteboard(not
I am creating a web chat application using asp.net vb. I have got the
I'm creating a chat application, I have the page check for updates from my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.