Hallo zusammen,
in einem Beispiel bin ich auf folgenden Code gestoßen:
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
| public class CommandViewModel : ViewModelBase { public CommandViewModel(string displayName, ICommand command) { if (command == null) throw new ArgumentNullException("command");
base.DisplayName = displayName; this.Command = command; }
public ICommand Command { get; private set; } } |
Man sieht, dass das Command-Property wie in einem Interface deklariert ist - trotzdem ist diese Klasse benutzbar.
Siehe im Konstruktor:
C#-Quelltext
1:
| this.Command = command; |
Wieso funktioniert das?? Was hab ich da verpasst?
Danke + Grüße
maxmeier