public MainPage()
        {
            InitializeComponent();
            _viewModel = App.MainViewModel;

            try
            {
                _translationService  = new TranslationService();
                _conversationService = new ConversationService();

                // Get the instance of LyncClient and subscribe to outgoing/incoming conversation events
                _lyncClient = LyncClient.GetClient();
                _lyncClient.StateChanged += new EventHandler <ClientStateChangedEventArgs>(LyncClient_StateChanged);

                _conversation = (Conversation)Microsoft.Lync.Model.LyncClient.GetHostingConversation();

                // Perform run-time registration using the ApplicationRegistration class.
                _myApplicationRegistration = _lyncClient.CreateApplicationRegistration(App.AppId, App.AppName);
                this._myApplicationRegistration.AddRegistration();
            }
            catch (ClientNotFoundException) { Console.WriteLine("Lync client was not found on startup"); }
            catch (LyncClientException lce) { MessageBox.Show("Lyncclientexception: " + lce.Message); }
        }
        public MainPage()
        {
            InitializeComponent();
            _viewModel = App.MainViewModel;

            try
            {
                _translationService = new TranslationService();
                _conversationService = new ConversationService();

                // Get the instance of LyncClient and subscribe to outgoing/incoming conversation events
                _lyncClient = LyncClient.GetClient();
                _lyncClient.StateChanged += new EventHandler<ClientStateChangedEventArgs>(LyncClient_StateChanged);

                _conversation = (Conversation)Microsoft.Lync.Model.LyncClient.GetHostingConversation();

                // Perform run-time registration using the ApplicationRegistration class.
                _myApplicationRegistration = _lyncClient.CreateApplicationRegistration(App.AppId, App.AppName);
                this._myApplicationRegistration.AddRegistration();
            }
            catch (ClientNotFoundException) { Console.WriteLine("Lync client was not found on startup"); }
            catch (LyncClientException lce) { MessageBox.Show("Lyncclientexception: " + lce.Message); }
        }