Click here to Skip to main content
15,878,871 members
Home / Discussions / C#
   

C#

 
AnswerRe: Adding dynamically a custom user control into a dockPanel in xaml file Pin
#realJSOP4-Dec-17 3:11
mve#realJSOP4-Dec-17 3:11 
AnswerRe: Adding dynamically a custom user control into a dockPanel in xaml file Pin
Mycroft Holmes4-Dec-17 13:21
professionalMycroft Holmes4-Dec-17 13:21 
AnswerRe: Adding dynamically a custom user control into a dockPanel in xaml file Pin
Gerry Schmitz4-Dec-17 18:59
mveGerry Schmitz4-Dec-17 18:59 
QuestionAlright. How the heck to they do it? Pin
#realJSOP3-Dec-17 6:37
mve#realJSOP3-Dec-17 6:37 
AnswerRe: Alright. How the heck to they do it? Pin
Luc Pattyn3-Dec-17 11:33
sitebuilderLuc Pattyn3-Dec-17 11:33 
GeneralRe: Alright. How the heck to they do it? Pin
Nathan Minier4-Dec-17 1:18
professionalNathan Minier4-Dec-17 1:18 
AnswerRe: Alright. How the heck to they do it? Pin
Kenneth Haugland4-Dec-17 0:30
mvaKenneth Haugland4-Dec-17 0:30 
GeneralRe: Alright. How the heck to they do it? Pin
#realJSOP4-Dec-17 3:02
mve#realJSOP4-Dec-17 3:02 
I'm trying to do this:

SomeRandomMethod(blah, blah, new { id=1,mystring="text"})


and when I get here:

C
public void SomeRandomMethod(dynamic obj)
{
    int id = obj.id;
    string text = obj.mystring;
}


the code throws exceptions because the properties don't exist.

Some might say, create a class with the same properties and cast it in the method, but then what's the point? If it's gotta be strongly typed, then it should be strongly typed where you're creating the instance (IMHO).
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

GeneralRe: Alright. How the heck to they do it? Pin
Kenneth Haugland4-Dec-17 3:12
mvaKenneth Haugland4-Dec-17 3:12 
GeneralRe: Alright. How the heck to they do it? Pin
#realJSOP4-Dec-17 3:15
mve#realJSOP4-Dec-17 3:15 
GeneralRe: Alright. How the heck to they do it? Pin
Richard Deeming4-Dec-17 4:32
mveRichard Deeming4-Dec-17 4:32 
GeneralRe: Alright. How the heck to they do it? Pin
#realJSOP4-Dec-17 7:03
mve#realJSOP4-Dec-17 7:03 
AnswerRe: Alright. How the heck to they do it? Pin
Nathan Minier4-Dec-17 1:21
professionalNathan Minier4-Dec-17 1:21 
AnswerRe: Alright. How the heck to they do it? Pin
Richard Deeming4-Dec-17 2:03
mveRichard Deeming4-Dec-17 2:03 
GeneralRe: Alright. How the heck to they do it? Pin
#realJSOP4-Dec-17 3:03
mve#realJSOP4-Dec-17 3:03 
Questionhow to clear file folder search on computer? Pin
Le@rner1-Dec-17 18:59
Le@rner1-Dec-17 18:59 
AnswerRe: how to clear file folder search on computer? Pin
OriginalGriff1-Dec-17 20:05
mveOriginalGriff1-Dec-17 20:05 
AnswerRe: how to clear file folder search on computer? Pin
Richard MacCutchan1-Dec-17 22:03
mveRichard MacCutchan1-Dec-17 22:03 
GeneralRe: how to clear file folder search on computer? Pin
Mycroft Holmes2-Dec-17 12:40
professionalMycroft Holmes2-Dec-17 12:40 
AnswerRe: how to clear file folder search on computer? Pin
Gerry Schmitz2-Dec-17 4:02
mveGerry Schmitz2-Dec-17 4:02 
QuestionTable object Pin
Member 1354537529-Nov-17 19:56
Member 1354537529-Nov-17 19:56 
AnswerRe: Table object Pin
OriginalGriff29-Nov-17 20:08
mveOriginalGriff29-Nov-17 20:08 
GeneralRe: Table object Pin
Member 1354537529-Nov-17 21:59
Member 1354537529-Nov-17 21:59 
GeneralRe: Table object Pin
OriginalGriff29-Nov-17 22:23
mveOriginalGriff29-Nov-17 22:23 
AnswerRe: Table object Pin
Richard MacCutchan29-Nov-17 21:47
mveRichard MacCutchan29-Nov-17 21:47 

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.