Given the following, when foois it connected?
foo
System.Timer t = new System.Timer( (a)=>{ var foo = Messages.SelectedItem as FooBar; });
Is this related, then an anonymous method is executed, or when the method is defined?
foonot bound at all, as it is internal to the anonymous method. It is called Message.SelectedItem. If Message is an instance property, then what is bound is an instance of 'this', which is used to receive messages.
, - , - System.Timer BCL. , System.Threading.Timer, / , i.e. , .
System.Timer
var t = new System.Threading.Timer(a => { var foo = a as FooBar; }, Messages.SelectedItem, -1, -1);
, , Messages.SelectedItem .
Messages.SelectedItem