コード例 #1
0
        public MainFrameView()
        {
            this.InitializeComponent();
            Window.Current.SetTitleBar(TitleBar);
            StaticContent.PlayerMenuFrame          = PlayerMenuFrame;
            StaticContent.NavigationContentService = new Services.NavigationService()
            {
                RootFrame = ContentFrame
            };
            PlayerMenuFrame.Navigate(typeof(PlayerMenuView));
            PlayerBottomFrame.Navigate(typeof(MiniPlayerView));
            if (StaticContent.IsPro)
            {
                AdsPanel.Height = new GridLength(0, GridUnitType.Pixel);
            }
            else
            {
                BottomAdsFrame.Navigate(typeof(AdsBottomPanelView));
            }

            Windows.UI.ViewManagement.ApplicationView appView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
            appView.SetPreferredMinSize(new Size(600, 800));

            this.SizeChanged += MainPage_SizeChanged;

            var timer2 = new DispatcherTimer();

            _timer2         = timer2;
            timer2.Interval = TimeSpan.FromSeconds(80);
            timer2.Tick    += Timer2_Tick;
            timer2.Start();

            if (!StaticContent.Config.IsRateMe & StaticContent.IsAuth)
            {
                var timer = new DispatcherTimer();
                this._timer    = timer;
                timer.Interval = TimeSpan.FromSeconds(60);
                timer.Tick    += Timer_Tick;
                timer.Start();
            }
            if (StaticContent.IsAuth)
            {
                if (InternetService.CheckConnection())
                {
                    StaticContent.NavigationContentService.Go(typeof(VKontakte.HomeView));
                }
                else
                {
                    InternetService.GoToOfflineMode();
                    //StaticContent.NavigationContentService.Go(typeof(HomeLocalView));
                }
            }
            else
            {
                StaticContent.NavigationContentService.Go(typeof(HomeLocalView));
            }
        }
コード例 #2
0
        private void LoadRates()
        {
            if (Rates != null)
            {
                return;
            }
            IsRunning = true;
            Result    = Languajes.MsgLoadingRates;

            if (InternetService.CheckConnection().IsSuccess)
            {
                LoadDataFromApi();
            }
            else
            {
                LoadLocalData();
            }
        }