public override void Search() { Proxy proxy = new Proxy(); if (Selected == "Kontakte") { ResultContact = proxy.Search(SearchText); Items.Clear(); if (ResultContact.contact != null) { foreach (var obj in ResultContact.contact) { Items.Add(new ContactViewModel(obj)); } } else { Contact obj = new Contact(); obj.Vorname = "Keinen Eintrag gefunden!"; obj.Id = "x"; Items.Add(new ContactViewModel(obj)); } } else { ResultFirm = proxy.SearchFirm(SearchText); Items.Clear(); if (ResultFirm.Firma != null) { foreach (var obj in ResultFirm.Firma) { Items.Add(new FirmViewModel(obj)); } } else { Firma obj = new Firma(); obj.Name = "Keinen Eintrag gefunden!"; obj.Id = "x"; Items.Add(new FirmViewModel(obj)); } } }