Click here to Skip to main content
15,892,927 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to return query result with method in c#??? Pin
littleGreenDude6-Feb-14 4:33
littleGreenDude6-Feb-14 4:33 
AnswerRe: how to return query result with method in c#??? Pin
V.6-Feb-14 19:35
professionalV.6-Feb-14 19:35 
QuestionRegEx problem [Solved] Pin
Marco Bertschi5-Feb-14 22:25
protectorMarco Bertschi5-Feb-14 22:25 
AnswerRe: RegEx problem Pin
OriginalGriff5-Feb-14 23:17
mveOriginalGriff5-Feb-14 23:17 
GeneralRe: RegEx problem Pin
Marco Bertschi5-Feb-14 23:29
protectorMarco Bertschi5-Feb-14 23:29 
GeneralRe: RegEx problem Pin
OriginalGriff5-Feb-14 23:33
mveOriginalGriff5-Feb-14 23:33 
GeneralRe: RegEx problem Pin
Marco Bertschi5-Feb-14 23:45
protectorMarco Bertschi5-Feb-14 23:45 
GeneralRe: RegEx problem Pin
OriginalGriff5-Feb-14 23:57
mveOriginalGriff5-Feb-14 23:57 
QuestionIqualProp in C# Pin
AshwiniSH5-Feb-14 19:43
professionalAshwiniSH5-Feb-14 19:43 
AnswerRe: IqualProp in C# Pin
Marco Bertschi5-Feb-14 20:26
protectorMarco Bertschi5-Feb-14 20:26 
AnswerRe: IqualProp in C# Pin
Dave Kreskowiak6-Feb-14 1:50
mveDave Kreskowiak6-Feb-14 1:50 
GeneralRe: IqualProp in C# Pin
AshwiniSH6-Feb-14 2:37
professionalAshwiniSH6-Feb-14 2:37 
GeneralRe: IqualProp in C# Pin
Dave Kreskowiak6-Feb-14 3:39
mveDave Kreskowiak6-Feb-14 3:39 
QuestionHow can I tell the difference between source and published .NET code? Pin
Xarzu5-Feb-14 10:35
Xarzu5-Feb-14 10:35 
AnswerRe: How can I tell the difference between source and published .NET code? Pin
Shameel5-Feb-14 20:15
professionalShameel5-Feb-14 20:15 
GeneralRe: How can I tell the difference between source and published .NET code? Pin
Bernhard Hiller5-Feb-14 21:17
Bernhard Hiller5-Feb-14 21:17 
GeneralRe: How can I tell the difference between source and published .NET code? Pin
OriginalGriff5-Feb-14 21:31
mveOriginalGriff5-Feb-14 21:31 
GeneralRe: How can I tell the difference between source and published .NET code? Pin
Shameel5-Feb-14 23:14
professionalShameel5-Feb-14 23:14 
AnswerRe: How can I tell the difference between source and published .NET code? Pin
jschell6-Feb-14 8:38
jschell6-Feb-14 8:38 
QuestionMVVM Observe VM Command Pin
eddieangel5-Feb-14 8:28
eddieangel5-Feb-14 8:28 
I am adapting a XAML Control to be MVVM compliant. Right now the XAML is actually not important, but there is one component that is giving me grief. The control is actually called from another view model on an event. Click here to add kind of thing. That command looks like this:

C#
private void OnAddItem()
{
    SubItemViewModel subVM = new SubItemViewModel(Key, null, false);
    IDisposable ss = Observable.FromEventPattern(subVM.Save, "ExecuteEnd").Take(1).Subscribe(x => { LoadList(); });
    SubControl ctrl = new SubControl();
    ctrl.DataContext = subVM;
    WorkspaceUserControlWindow w = new WorkspaceUserControlWindow(ctrl);
    w.Title = subVM.DisplayTitle ?? Key.Value + " - Add Item";
    Observable.FromEventPattern(w, "Closed").Take(1).Subscribe(x => { if (ss != null) ss.Dispose(); });
    w.Show();
}


This worked fine in a non-MVVM model using a delegate command, click events, etc... Now that I have migrated the VM over to MVVM I need to understand how to publish the Save command so that the calling event can listen for the ExecuteEnd and reload the data list as shown here:

C#
IDisposable ss= Observable.FromEventPattern(subVM.Save, "ExecuteEnd").Take(1).Subscribe(x => { LoadList(); });


I have always used relay commands within my view models as I have never needed to observe a command like this. Thoughts?

Cheers, --EA
Questionweb.config file access in another project Pin
vkEE5-Feb-14 7:31
vkEE5-Feb-14 7:31 
QuestionRe: web.config file access in another project Pin
Richard Deeming5-Feb-14 8:05
mveRichard Deeming5-Feb-14 8:05 
AnswerRe: web.config file access in another project Pin
Marco Bertschi5-Feb-14 20:28
protectorMarco Bertschi5-Feb-14 20:28 
GeneralRe: web.config file access in another project Pin
vkEE7-Feb-14 3:50
vkEE7-Feb-14 3:50 
GeneralRe: web.config file access in another project Pin
Marco Bertschi7-Feb-14 3:56
protectorMarco Bertschi7-Feb-14 3:56 

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.