private MenuItem BuildMenuForMember(MemberViewModel member) { var mi = new MenuItem { Header = member.DisplayName }; mi.Items.Add(new MenuItem { Header = "Yhteystiedot", Padding = new Thickness(0.1) }); mi.Items.Add(new Separator()); foreach (var item in member.GetRelatedContacts()) { Contact contact = item; mi.Items.Add(new MenuItem { Header = String.Format("{0} {1}", contact.firstname, contact.lastname), Command = new RelayCommand(delegate { ShowEditContactWindow(contact, member); }) }); } mi.Items.Add(new MenuItem { Header = "Lisää uusi", Command = new RelayCommand(delegate { ShowEditContactWindow(null, member); }) }); return mi; }