tagged [delegates]
How do I Unregister 'anonymous' event handler
How do I Unregister 'anonymous' event handler Say if I listen for an event: Now how do I un-register this event? Or just allow the memory to leak?
- Modified
- 28 Aug at 16:35
combining flipsideview and navigationview
combining flipsideview and navigationview when i am trying to combine flipsideview and navigation view i am getting following error "request for member 'delegate' is something not in a structure or un...
- Modified
- 24 Nov at 06:51
Why would you use Expression<Func<T>> rather than Func<T>?
Why would you use Expression> rather than Func? I understand lambdas and the `Func` and `Action` delegates. But expressions stump me. In what circumstances would you use an `Expression>` rather than a...
- Modified
- 19 Apr at 13:53
What's the difference between QueueUserWorkItem() and BeginInvoke(), for performing an asynchronous activity with no return types needed
What's the difference between QueueUserWorkItem() and BeginInvoke(), for performing an asynchronous activity with no return types needed Following on from my BeginInvoke()/EndInvoke() question, are th...
- Modified
- 10 Feb at 15:27
Why do we need C# delegates
Why do we need C# delegates I never seem to understand why we need delegates? I know they are immutable reference types that hold reference of a method but why can't we just call the method directly, ...
Func vs. Action vs. Predicate
Func vs. Action vs. Predicate With real examples and their use, can someone please help me understand: 1. When do we need a Func delegate? 2. When do we need an Action delegate? 3. When do we need a P...
Can I use params in Action or Func delegates?
Can I use params in Action or Func delegates? When I'm trying to use params in an Action delegate... I received this design time error: > Invalid token 'params' in class, struct, or interface member d...
- Modified
- 30 Oct at 16:52
Can someone distill into proper English what a delegate is?
Can someone distill into proper English what a delegate is? Can someone please break down what a delegate is into a simple, short and terse explanation that encompasses both the purpose and general be...
Check if an object is a delegate
Check if an object is a delegate In .NET, Is there a way to check whether an object is of a delegate type? I need this because I'm logging the parameters of method calls, and I want to print `"(delega...
LINQ vs Lambda vs Anonymous Methods vs Delegates
LINQ vs Lambda vs Anonymous Methods vs Delegates 1. Can anyone explain what are the LINQ, Lambda, Anonymous Methods, Delegates meant? 2. How these 3 are different for each other? 3. Was one replaceabl...
- Modified
- 11 May at 14:9
Uses of Action delegate in C#
Uses of Action delegate in C# I was working with the Action Delegates in C# in the hope of learning more about them and thinking where they might be useful. Has anybody used the Action Delegate, and i...
Difference between wiring events with and without "new"
Difference between wiring events with and without "new" In C#, what is the difference (if any) between these two lines of code? and Both appear to work exactly the same. Does C# just assume you mean t...
Understanding Lambda expressions and delegates
Understanding Lambda expressions and delegates I have been trying to figure this out for quite sometime (reading online blogs and articlaes), but so far unsuccessful. What are delegates? What are Lam...
How do I set up a simple delegate to communicate between two view controllers?
How do I set up a simple delegate to communicate between two view controllers? I have two `UITableViewControllers` and need to pass the value from the child view controller to the parent using a deleg...
- Modified
- 10 May at 02:30
C#: Difference between ' += anEvent' and ' += new EventHandler(anEvent)'
C#: Difference between ' += anEvent' and ' += new EventHandler(anEvent)' Take the below code: --- What is the difference between the following ? Apparently, there is no difference between the two...th...
- Modified
- 14 Dec at 22:24
Parameter count mismatch with Invoke?
Parameter count mismatch with Invoke? The code block below results in the error: TargetParameterCountException was unhandled by user code. Parameter count mismatch. ``` public void AddListViewItem(str...
- Modified
- 15 Sep at 21:29
Assigning events in object initializer
Assigning events in object initializer Why isn't it possible to assign events along with properties in object initializers in C#? It seems to be so natural to do so. Or is there some trick that I don'...
- Modified
- 22 Oct at 04:21
Delegate for any method type - C#
Delegate for any method type - C# I want to have a class that will execute any external method, like this: Is this possible? Is there a delegate that takes any method signatur
- Modified
- 22 Feb at 18:59
Invoke(Delegate)
Invoke(Delegate) Can anybody please explain this statement written on this [link](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.invoke.aspx) Executes the specified delegate on t...
Casting Func<T> to Func<object>
Casting Func to Func I'm trying to figure out how to pass `Func` to `Func` method argument: Actually I want it to work in Silverlight, and I have input parameters like `Func`
- Modified
- 14 Jan at 15:5
Using C# delegates with methods with optional parameters
Using C# delegates with methods with optional parameters Is there a chance to make this code work? Of course I can make second definition of Foo, but I think it'd be a little non-elegant ;)
- Modified
- 20 Apr at 10:56
What does a delegate point to?
What does a delegate point to? I have read that a reference type holds the reference to an actual object which may be stored on the managed heap. When a method is "assigned" to a delegate reference va...
A delegate for a function with variable parameters
A delegate for a function with variable parameters I have a function of this sort It can accept parameters of the following sort and so on. I wanted to create an `Action` delegate for the above functi...
Delegate: Method name expected error
Delegate: Method name expected error I'm trying to get the following simple Delegate example working. According to a book I've taken it from it should be ok, but I get a `Method name expected` error. ...