How to add toast notification to WPF application?

Feb 6, 2015 at 12:53 PM
Edited Feb 6, 2015 at 1:27 PM
I've downloaded and reference the "using Mantin.Controls.Wpf;" but I'm not sure
how to actually implement the library.

I then added a toast in my button click:

"new ToastPopUp("Submit Failed!", "Progress data did not sumbit correctly, please check you network connection",
                NotificationType.Information).Show();
"

But when I run, I keep getting the error:

"Error 2 The type 'System.Drawing.Bitmap' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."

Although I have using System.Drawing; defined at the top of the class.



Brian V
Coordinator
Feb 6, 2015 at 1:54 PM
I bet that you are targeting the 4.5 Framework. This library is a 4.0 assembly. All you need to do is add the 4.0.0.0 version of System.Drawing to your project and you should be good to go.

I was able to recreate your issue by creating a new project, added the control via NuGet, copied your code and got the same error. To fix this, right clicked on my project's properties, which opened the "Reference Manager" window. Selected "Assemblies" on the left. Selected "System.Drawing" (make sure that it is 4.0.0.0).

I'll see about changing the NuGet package to include this reference. Thanks for pointing it out, and let me know if this works for you.

Lawrence
Marked as answer by accessguru on 4/23/2015 at 5:38 AM