This is a migrated thread and some comments may be shown as answers.

Messaging

1 Answer 139 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 04 Apr 2013, 06:07 PM
Hi,

What is the best practices for the following situation?

1) I have a MainWindow / Menu / MenuItemA
    I click MenuItem and want another window to display say [EditWindow].

2) from [EditWindow] i want to click /Contextmenu/MenuItemB and open yet another form [AnotherEditWindow]

Does Telerik provide some type of messaging system, mediator pattern?

How should this be coded to MVVM standards, I've read the MenuItemB.Command executes on MainWIndowViewModel, raising an event that
MainWIndow has subscribed too. In code behind i create EditWIndow.

Same for EditWindow, MenuItemB.Command executes on EditWindowViewModel, raising an event that EditWindow has subscribed too, and creates AnotherEditWindow.

OR.

just use routedEvents to code behind and create new windows like Winforms development?

OR

Use some framework?

Thanks
Gary


1 Answer, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 10 Apr 2013, 07:58 AM
Hi Gary,

I believe the approach you described with commands is a great solutions for this case. It is MVVM friendly, simple and doesn't require lots of code. Another possible solution that you might prefer is to use delegates instead of events into your ViewModel. This way your code will be even more straightforward.
Currently there is nothing specific provided by Telerik for this, because it can be handled using the WPF framework with ease.

Kind regards,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
General Discussions
Asked by
Gary
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or