コード例 #1
0
        private void InitializeWithCurrentOrientation()
        {
            var background = AddPendingBackground(Util.IsLandscape());

            if (this._loading.Superview == null)
            {
                this.View.AddSubview(_loading);
            }
            _loading.Show();

            RemovePager();

            ThreadPool.QueueUserWorkItem(s =>
            {
                var startAt = _rotating && _pager != null ? _pager.Page : 0;

                InitializePager(startAt);

                SetPiecesAffectedByLightSwitch();

                InvokeOnMainThread(() =>
                {
                    // Swap the placeholder image for the gallery
                    this.View.AddSubview(_pager.View);
                    background.RemoveFromSuperview();
                    background.Dispose();

                    PlaceLightButton();

                    _loading.CompleteAndDismissWithTitle("Ready!", 1.0f, CompleteLoad);

                    // Slide to a piece if one is queued for display
                    if (_queuedPage.HasValue)
                    {
                        SetPage(_queuedPage.Value);
                        _queuedPage = null;
                    }
                });
            });
        }