coson
coson

Reputation: 8659

DelegateCommand Newbie Question

I'm trying to get up to speed with PRISM and how it works with Silverlight/WPF. Is it possible to using DelegateCommands to open a new popup (Silverlight Window). If so, how would I go about doing something like this.

Most of the samples I've seen so far involve using DelegateCommands to retrieve data (or some other similar action).

If anyone has any suggestions, I'd appreciate it.

Upvotes: 0

Views: 600

Answers (1)

Jeremiah Morrill
Jeremiah Morrill

Reputation: 4268

I use the delegate command to essentially execute a method and/or pass data back to the ViewModel.

A popup, is a presentation facility, so I don't see anything wrong with adding an event handler to a button and loading up a popup from codebehind. I would suggest a more infrastructure/reusable approach by either creating some sort of IDialogService or instantiating your popups ViewModel/View and exposing the View via view injection or binding to a content control.

Upvotes: 4

Related Questions