-1

Notification Button

i wanna add a badge notification to that button , using Devexpress MVVM Architecture

TraiOmar
  • 3
  • 2
  • 1
    Hi, please show us what you have tried and try to read about [ask] – Stefan Jun 08 '18 at 10:26
  • i don't know from where to start that's the issue – TraiOmar Jun 08 '18 at 10:44
  • In that case, it's worth to do some research yourself. Start with a visual representation of the badge notification button in XAML. Then add some MVVM properties to interact with it. Try to duckduckgo a bit around – Stefan Jun 08 '18 at 10:48
  • ive already done some research before asking the question, ive found this https://documentation.devexpress.com/WindowsForms/DevExpress.Utils.VisualEffects.AdornerUIManager.class and https://documentation.devexpress.com/WindowsForms/DevExpress.Utils.VisualEffects.Badge.class , but i dont know how to implement it – TraiOmar Jun 08 '18 at 11:31
  • I am not a devexpress expert, but the article is about a winforms control. The thing is: winforms is totally different than WPF. Maybe that would be a starting point. Do you have any XAML in your code? – Stefan Jun 08 '18 at 11:36

1 Answers1

0

There are two possible approaches of accomplishing the task you described.

Simple(for predefined badge):
Create the ShowXXX property at the ViewModel side and bind this property to the Badge.Visible property of the specific badge created and designed earlier in the WinForms designer:

// ViewModel side
public class ViewModel {
    public virtual bool ShowAlarm { get; set; }
}
...
// View side
var fluent = mvvmContext.OfType<ViewModel>();
fluent.SetBinding(alarmBadge, b => b.Visible, x => x.ShowAlarm);

Complex(for dynamically generated badges):

Create custom implementation of the INotificationService based on the AdornerUIManager's component API. This way requires some coding, but allows you to handle any scenarios. I suggest you contact the DevExpress support directly if you're running into a trouble with this way.

DmitryG
  • 17,677
  • 1
  • 30
  • 53