Click here to Skip to main content
15,867,765 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF DialogService Question Pin
Kevin Marois31-Dec-13 5:54
professionalKevin Marois31-Dec-13 5:54 
GeneralRe: WPF DialogService Question Pin
Ron Beyer31-Dec-13 6:09
professionalRon Beyer31-Dec-13 6:09 
GeneralRe: WPF DialogService Question Pin
Mycroft Holmes6-Jan-14 21:57
professionalMycroft Holmes6-Jan-14 21:57 
QuestionConvert BitmapImage into byte arrays in wpf Pin
Member 1001614027-Dec-13 0:23
Member 1001614027-Dec-13 0:23 
AnswerRe: Convert BitmapImage into byte arrays in wpf Pin
Pete O'Hanlon27-Dec-13 0:58
subeditorPete O'Hanlon27-Dec-13 0:58 
GeneralRe: Convert BitmapImage into byte arrays in wpf Pin
Member 1001614027-Dec-13 3:44
Member 1001614027-Dec-13 3:44 
QuestionWPF App Content Presenter in Main Window Pin
Kevin Marois23-Dec-13 7:21
professionalKevin Marois23-Dec-13 7:21 
AnswerRe: WPF App Content Presenter in Main Window Pin
SledgeHammer0123-Dec-13 10:22
SledgeHammer0123-Dec-13 10:22 
I recently discovered CompositeCommand and find it works great for this scenario. It's part of Prism, but I just ripped it out since I don't use Prism.

https://prism.svn.codeplex.com/svn/V1/spikes/AGCompositeApplicationLibrary/AGComposite.Wpf/Commands/CompositeCommand.cs[^]

The toolbar will bind to a static CompositeCommand (i.e. in something like a GlobalCommands.cs) and then a view would attach to it with a RelayCommand. Something like:

GlobalCommands.SaveCommand.RegisterCommand(SaveCommand);

Multiple views can attach to the same command and all get notified when the button is clicked. The one gotcha though is the IActiveAware portion. Your ViewModelBase class needs to be tweaked to properly set the IsActive flags in the commands somehow.

Basically the way the CompositeCommand works is that say vmA and vmB attach... by default, the button will only enable if both return true for canExecute. By setting the IsActive flag on the commands properly, you can make it work in a way where the inactive commands are ignored. For example, if vmA.SaveCommand is not active, only vmB.SaveCommand will get the canexecute/execute calls.
GeneralRe: WPF App Content Presenter in Main Window Pin
Kevin Marois3-Jan-14 10:29
professionalKevin Marois3-Jan-14 10:29 
QuestionHow to add certificate in Local Machine Pin
Sugu.s19-Dec-13 22:50
Sugu.s19-Dec-13 22:50 
QuestionWPF user control not working Pin
sridhar chanti18-Dec-13 2:33
sridhar chanti18-Dec-13 2:33 
SuggestionRe: WPF user control not working Pin
Matt T Heffron18-Dec-13 7:38
professionalMatt T Heffron18-Dec-13 7:38 
QuestionSILVER LIGHT Pin
Member 1047161416-Dec-13 23:16
Member 1047161416-Dec-13 23:16 
AnswerRe: SILVER LIGHT Pin
Pete O'Hanlon16-Dec-13 23:44
subeditorPete O'Hanlon16-Dec-13 23:44 
GeneralRe: SILVER LIGHT Pin
Mycroft Holmes17-Dec-13 0:05
professionalMycroft Holmes17-Dec-13 0:05 
GeneralRe: SILVER LIGHT Pin
Pete O'Hanlon17-Dec-13 0:17
subeditorPete O'Hanlon17-Dec-13 0:17 
AnswerRe: SILVER LIGHT Pin
Marco Bertschi17-Dec-13 0:12
protectorMarco Bertschi17-Dec-13 0:12 
AnswerRe: SILVER LIGHT Pin
Mohit Dharmadhikari18-Dec-13 19:44
Mohit Dharmadhikari18-Dec-13 19:44 
GeneralRe: SILVER LIGHT Pin
Mycroft Holmes18-Dec-13 21:31
professionalMycroft Holmes18-Dec-13 21:31 
GeneralRe: SILVER LIGHT Pin
Mohit Dharmadhikari19-Dec-13 18:52
Mohit Dharmadhikari19-Dec-13 18:52 
GeneralRe: SILVER LIGHT Pin
Mycroft Holmes19-Dec-13 19:05
professionalMycroft Holmes19-Dec-13 19:05 
QuestionWhich control to use? Pin
Mycroft Holmes16-Dec-13 16:25
professionalMycroft Holmes16-Dec-13 16:25 
AnswerRe: Which control to use? Pin
SledgeHammer0116-Dec-13 17:57
SledgeHammer0116-Dec-13 17:57 
GeneralRe: Which control to use? Pin
Mycroft Holmes16-Dec-13 18:55
professionalMycroft Holmes16-Dec-13 18:55 
Questionvalidations with in atextbox(mobileno) Pin
Member 1046914216-Dec-13 0:06
Member 1046914216-Dec-13 0:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.