May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Contra variance basically works the opposite of covariance: From a derived class we can take advantage of an abstract class or of a base class. To understand how contra variance works, the best example is to create a client application in which two events of the same control are handled by the same event handler. For this, create a new Windows Presentation Foundation application and write the following XAML code to define a simple Button control:
<Button Content="Button" Height="50" Name="Button1" Width="150" />
Read now
Unlock full access