Notification Center

Is there any reason not to use Rhino.Runtime.Notifications? I can’t find much information about using it for a third-party plugin.

Maybe rightly or wrongly we seem to have increasing user messages of varying importance and notification center seems like an ideal place to chuck some of them instead of using message boxes…

If there’s any further docs on Notifications would be interested – especially on what TrulyObservableOrderedSet and IAssemblyRestrictedObject are for…

1 Like

Luke,

You can add notifications to Rhino’s Notification Center like this:

This is a quick sample I wrote that worked for me.

1 Like

Thanks @jstevenson! Are you using notifications in JewelBeetle? Do you have any tips for using it?

1 Like

Yes we do. Since we don’t typically show the Rhino UI, we use a third-party NuGet package called ToastNotifications. It works quite well for our needs. The only thing I still plan to do is add a History UI, to be able to review past toast notifications.

ToastNotifications supports several types of notifications which you see demonstrated in my video here, just make sure if you call a toast from a background thread, that you marshall the call onto the UI thread, otherwise you’ll get “stuck” notifications on your screen.

1 Like

ToastNotifications look interesting… thanks for sharing… but the video isn’t loading for me sorry :frowning:

Weird works on my phone and pc. Doesn’t get much more compatible than MP4 video…

1 Like

Switched to chrome and is working :+1:

So your ToastNotifications are synced with the notification center?

Can I also ask about how you handle collated messages (if you have any?). We have some commands/methods that might update 1000s of curves in a model and then report which ones succeeded or fail… at the moment it ends up as very unglamorous text in a message box… :disappointed_relieved:

We do not use Rhino at all for notifications, I wrote that method just for you and tested redirecting there to see how it works.

If we have a lot to say other than a quick toast message we use. Custom Dialog window. I develop our UI in WPF.

Toasts are just brief sentences for us like, “Render saved to Project” or “Design Saved to c:/…”

We also have a preference that allows users to redirect toast notifications to the command prompt in Rhino.

1 Like

Ahh apologies I misunderstood you. :disappointed_relieved:

I confess I’m not sure how your program works with Rhino – are you suggesting ToastNotifications + custom dialog for long-messages is a better approach than using the NotificationCenter?

I’ve been looking at how other software go about it, i.e. revits messages


Any other suggestions or references are appreciated – and thank you for the code example :grin:

1 Like