public ContactWithFavouritesViewModel(Contact contact, Outlook outlook, Favourites favourites)
        {
            if (contact == null)
                throw new ArgumentNullException("Contact");
            if (outlook == null)
                throw new ArgumentNullException("Outlook");

            Outlook = outlook;

            Contact = contact;
            Contact.PropertyChanged += Contact_PropertyChanged;

            Favourites = favourites;
            Favourites.PropertyChanged += Favourites_PropertyChanged;
            //Contact = favourites.FirstOrDefault(x => x.FullName == contact.FullName);
            //ParentContact = contact;
            //if (Contact.IsEmpty() && !ParentContact.IsEmpty())
            //    Contact.Copy(ParentContact);
            //Contact.PropertyChanged += Contact_PropertyChanged;

            AddressBookCommand = new RelayCommand(AddressBookPressed);
            ClearCommand = new RelayCommand(ClearPressed, CanClear);
            AddFavouriteCommand = new RelayCommand(AddFavouritePressed, CanAddFavourite);
            RemoveFavouriteCommand = new RelayCommand(RemoveFavouritePressed);
        }
Пример #2
0
        public ListBoxContacts()
        {
            Title = "Recipients";
            Contacts = new ObservableCollection<Contact>();
            AddCommand = new RelayCommand(AddPressed);

            Contacts.Add(new ListBoxContact(this) { FirstName = "Matthew", LastName = "Fitzmaurice", FullName = "Matthew Fitzmaurice" });
            Contacts.Add(new ListBoxContact(this) { FirstName = "Marcia", LastName = "Fitzmaurice", FullName = "Marcia Fitzmaurice" });
        }
 public PrecedentInstructionViewModel(PrecedentInstruction Details, Wd.ContentControl control, IList<string> Namespaces)
 {
     this.Details = Details;
     this.Namespaces = Namespaces;
     if (control.Type == Wd.WdContentControlType.wdContentControlComboBox)
         IsComboBox = true;
     if (control.Type == Wd.WdContentControlType.wdContentControlDate && control.DateStorageFormat != Wd.WdContentControlDateStorageFormat.wdContentControlDateStorageDate)
         control.DateStorageFormat = Wd.WdContentControlDateStorageFormat.wdContentControlDateStorageDate;
     OKCommand = new RelayCommand(OKPressed, CanPressOK);
 }
Пример #4
0
        public ContactViewModel(Contact contact, Outlook outlook, string examplePhoneNumber = "", List<string> deliveryItems = null)
        {
            this.contact = contact;
            Outlook = outlook;
            ExamplePhoneNumber = examplePhoneNumber;

            AddressBookCommand = new RelayCommand(AddressBookPressed);
            ClearCommand = new RelayCommand(ClearPressed, CanClear);

            DeliveryItems = deliveryItems ?? new List<string>();
        }
Пример #5
0
 public ListBoxContact(ListBoxContacts parent)
 {
     _Parent = parent;
     EditCommand = new RelayCommand(EditPressed);
     RemoveCommand = new RelayCommand(RemovePressed);
 }
 public ChangeOfficeViewModel(IUserSettings settings)
 {
     this.settings = settings;
     OKCommand = new RelayCommand(OKPressed, CanPressOK);
 }