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 4268146
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:59:44+00:00 2026-05-21T06:59:44+00:00

Using VB.net 4.0 I have a Winforms application that is loosely based on MVVM.

  • 0

Using VB.net 4.0

I have a Winforms application that is loosely based on MVVM. I’m looking for an easy way for any layer (even those that the UI has no reference to) to pass messages back to the UI for display to the user.

I have accomplished this in the past by creating a “Communicator” class in a “Common” assembly that every other assembly would reference.

Public Class Communicator

Public Shared Sub NotifyUser(Message as string)
    RaiseEvent SendMessage(Message)
End Sub

Public Shared Event SendMessage(MessageToSend as string)

End Class 

The UI would subscribe to the SendMessage event at program startup. Any class wanting to pass a message to the user would simply call the Shared NotifyUser method and the Communicator class would relay the given message to the UI through the SendMessage event.

The upside to this method is that it is trivial to implement and super easy to use from anywhere in your code.

I suppose the downside to this is that calls to NotifyUser are spread throughout your code, making many classes dependent on the Communicator class and its shared method. For some reason, it just feels wrong.

So, my question is, what are some typical ways to achieve the same effect without a significant increase in complexity?

  • 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-05-21T06:59:45+00:00Added an answer on May 21, 2026 at 6:59 am

    Honestly events are fine (with the downsides you pointed out). Another option is the Mediator pattern, which is more or less what it sounds like you’ve implemented, just without events.

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

Sidebar

Related Questions

I have a .NET WinForms application that I've converted into a COM dll using
I have a .net 3.5 WinForms application that runs fine on my machine, but
I have a .net WinForms 2.0 application that has an image library of about
Using .NET 1.1, I have a DataGrid that contains three columns for each row.
I'm using asp.net/c# and have a number of Collapsible Panel Extenders that have been
We have an application written in C#, using .NET Framework 3.0 or 3.5 or
I am developing a winforms application using .NET 2.0 and Sql Server 2005. I
I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
Using the .net framework you have the option to create temporary files with Path.GetTempFileName();
I'm using .NET 3.5 and I have a class, A, marked as internal sealed

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.