コード例 #1
0
        public MainPage()
        {
            InitializeComponent();

            DefaultSettings.AddDefaultAccount();

            DefaultSettings.AddLocalServerAccount();

            _call = SetCall();

            DefaultSettings.AddDefaultIceServersList(_call);

            InitEvents();

            InitView();
        }
コード例 #2
0
        public MainPage()
        {
            AddDefaultAccount();

            InitializeComponent();

            _accountModel = _localSettings.DeserializeSelectedAccount();

            SetAccount(_accountModel?.ServiceUri);

            //_signaler = (HttpSignaler)GuiLogic.Instance.Account.Signaler;

            _call = SetCall();

            _call.OnSendMessageToRemotePeer += Call_OnSendMessageToRemotePeer;
            _call.OnSignedOut += Call_OnSignedOut;

            AddDefaultIceServersList();

            Loaded += OnLoaded;

            Debug.WriteLine($"Connecting to server from local peer: {_signaler.LocalPeer.Name}");

            peersListView.SelectedIndex = -1;
            peersListView.SelectedItem  = 0;

            _signaler.SignedIn += Signaler_SignedIn;
            _signaler.ServerConnectionFailed += Signaler_ServerConnectionFailed;
            _signaler.PeerConnected          += Signaler_PeerConnected;
            _signaler.PeerDisconnected       += Signaler_PeerDisconnected;
            _signaler.MessageFromPeer        += HttpSignaler_MessageFromPeer;

            _call.OnPeerConnectionCreated += async() =>
                                             await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, ()
                                                                       => Frame.Navigate(typeof(CallPage), _call));

            InitView();

            NavigationCacheMode = NavigationCacheMode.Required;
        }