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

  • SEARCH
  • Home
  • 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 8564733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:15:54+00:00 2026-06-11T17:15:54+00:00

I am trying to implement a notifyicon ( http://www.hardcodet.net/projects/wpf-notifyicon ) in MVVM project. I

  • 0

I am trying to implement a notifyicon (http://www.hardcodet.net/projects/wpf-notifyicon) in MVVM project. I understand this control is meant to be used in a regular WPF project.

I am wondering how to implement the ballon feature (Balloon feature).
As specified in this tutorial the method “ShowBallonTip” needs to be called

//show balloon with built-in icon
  MyNotifyIcon.ShowBalloonTip(title, text, BalloonIcon.Error);

The only place I could call this method, I can think of, is in the code behind. I do not have a problem with having a little code in a view code behind (even if I would prefer not having any) but I can not figure out how I can have the view model to talk to the view and asks it to call this method.

Even if I place this method in an event how can I raise this event programatically from the viewmodel?

Any idea how I could achieve this?

  • 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-11T17:15:55+00:00Added an answer on June 11, 2026 at 5:15 pm

    I have been able to display a balloon tip by initialising the icon in the viewmodel instead of the XAML.

    Just calling the ShowBalloonTip method in my command do the trick.

    I created a wrapper for the notify Icon:
    NotifyService:

    public class NotifyService : INotifyService
    {
        private TaskbarIcon icon = new TaskbarIcon
            {
                Name = "NotifyIcon",
                Icon =
                    new System.Drawing.Icon(
                        Application.GetResourceStream(Utils.FileUtils.MakeUri("/Icons/email.ico")).Stream),
            };
    
    
        public void Notify(string message)
        {
    
            icon.ShowBalloonTip("title", message, BalloonIcon.None);
        }
    
        public void ChangeIconSource(string path)
        {
            icon.Icon = new System.Drawing.Icon(
                        Application.GetResourceStream(Utils.FileUtils.MakeUri(path)).Stream);
        }
    }
    

    And I used it in my view model:
    viewmodel

    public class MainWindowViewModel : WindowViewModelBase
    {
        private readonly INotifyService notifyService = new NotifyService();
    
        #region Fields
        private static HomeWindowViewModel homeViewModel = new HomeWindowViewModel();
        #endregion
        /// Initializes a new instance of the <see cref="MainWindowViewModel"/> class.
        /// </summary>
        public MainWindowViewModel()
            : base()
        {
            CurrentViewModel = homeViewModel;
        }
    
        #region Methods
    
        protected override void OnViewModelPropertyChanged(IViewModel viewModel, string propertyName)
        {
            int t = 2;
        }
    
        protected override void OnViewModelCommandExecuted(IViewModel viewModel, ICatelCommand command, object commandParameter)
        {
            int t = 2;
            notifyService.ChangeIconSource(@"/Icons/new_email.ico");
            notifyService.Notify("test");
        }
        #endregion
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to implement the excellent jQuery bidirectional infite scroll as explained here: http://www.bennadel.com/blog/1803-Creating-A-Bidirectional-Infinite-Scroll-Page-With-jQuery-And-ColdFusion.htm For
Trying to implement this gallery on my website. http://coffeescripter.com/code/ad-gallery/ It is noted in the
Trying to implement a MSMQ-backed WCF PubSub. I understand that net.msmq is one-way; however
Trying to implement a search similar to here .This searches properties based on city,locality,property
Trying to implement 3-layer (not: tier, I just want to separate my project logically,
Trying to implement an autocomplete based on this It looks like it's very straight
I've a webbrowser control and I'm trying implement IDocHostUIHandler in the container. However since
I have this weird kind of error. I am trying implement basic Euclidean algorithm
I'm trying implement a bracket in my program (using C#/.NET MVC) and I am
Trying to implement a shell, mainly piping. I've written this test case which I

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.