コード例 #1
0
ファイル: VoIPService.cs プロジェクト: vipadm/Unigram
        private async void Show(Call call, VoIPControllerWrapper controller)
        {
            if (_callPage == null)
            {
                if (ApiInformation.IsMethodPresent("Windows.UI.ViewManagement.ApplicationView", "IsViewModeSupported") && ApplicationView.GetForCurrentView().IsViewModeSupported(ApplicationViewMode.CompactOverlay))
                {
                    _callLifetime = await _viewService.OpenAsync(() => _callPage = _callPage ?? new PhoneCallPage(ProtoService, CacheService, Aggregator, _call, _controller), 0);

                    _callLifetime.Released += (s, args) =>
                    {
                        _callPage.Dispose();
                        _callPage = null;
                    };
                }
                else
                {
                    _callPage = new PhoneCallPage(ProtoService, CacheService, Aggregator, _call, _controller);

                    _callDialog = new ContentDialogBase();
                    _callDialog.HorizontalAlignment = HorizontalAlignment.Stretch;
                    _callDialog.VerticalAlignment   = VerticalAlignment.Stretch;
                    _callDialog.Content             = _callPage;
                    _callDialog.IsOpen = true;
                }
            }

            _callPage.BeginOnUIThread(() =>
            {
                if (controller != null)
                {
                    _callPage.Connect(controller);
                }

                _callPage.Update(call);
            });
        }