public ContactsListViewModel(bool isLoadAllContacts = true)
        {
            _ciscoService      = DependencyService.Resolve <CiscoService>();
            _navigationService = DependencyService.Get <INavigationService>();


            if (isLoadAllContacts)
            {
                _allContacts     = _ciscoService.GetContactList().Data;
                FilteredContacts = new ObservableCollection <Contact>();
                foreach (var contact in _allContacts)
                {
                    FilteredContacts.Add(contact);
                }
            }
        }
Esempio n. 2
0
        public DialingViewModel(Contact contact)
        {
            CurrentStatus = "Calling";
            Contact       = contact;
            _ciscoService = DependencyService.Get <CiscoService>();
            var result = _ciscoService.StartCall(contact.Address);

            PresentationButtonText = "Start presentation";
            MuteButtonText         = "Mute microphhone";
            if (result.IsSuccessed)
            {
                CurrentStatus = "In call";
                _callId       = result.Data;
                IsConnected   = true;
            }
            else
            {
                CurrentStatus = "Call failed";
                IsConnected   = false;
            }
        }
Esempio n. 3
0
 public ContactDetailsViewModel(Contact contact)
 {
     Contact       = contact;
     _ciscoService = DependencyService.Get <CiscoService>();
     _actionType   = ContactAction.Update;
 }
Esempio n. 4
0
 public ContactDetailsViewModel()
 {
     Contact       = new Contact();
     _ciscoService = DependencyService.Get <CiscoService>();
     _actionType   = ContactAction.Add;
 }