Ejemplo n.º 1
0
 protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
 {
     ListBox_News.SelectedIndex = -1;
     SystemTray.SetBackgroundColor(this, Color.FromArgb(255, 24, 22, 22));
     SystemTray.SetForegroundColor(this, Color.FromArgb(255, 255, 255, 254));
     base.OnNavigatedTo(e);
 }
Ejemplo n.º 2
0
            private void SetSystemComponentColors(PhoneApplicationPage page, Color background, Color foreground, Color chrome)
            {
                if (page != null)
                {
                    // Corrects the issue where white foreground text and the
                    // light theme on the phone will then have invisible
                    // progress indicator text.
                    Color systemTrayForeground = foreground;
                    if (Colors.White == foreground && _themeAtStartup == Theme.Light)
                    {
                        systemTrayForeground = AlmostWhite;
                    }

                    SystemTray.SetBackgroundColor(page, background);
                    SystemTray.SetForegroundColor(page, systemTrayForeground);

                    if (OverrideOptions == ThemeManagerOverrideOptions.SystemTrayAndApplicationBars)
                    {
                        var appBar = page.ApplicationBar as IApplicationBar;
                        if (appBar != null)
                        {
                            appBar.MatchOverriddenTheme();
                        }
                    }
                }
            }
Ejemplo n.º 3
0
 void SetNavigatedPage(PhoneApplicationPage navigatedPage)
 {
     ProgressBar.UIElement = navigatedPage;
     if (navigatedPage != null)
     {
         navigatedPage.Loaded += (sender, args) => SystemTray.SetBackgroundColor(navigatedPage, ColorTranslator.FromHtml("#10283a"));
     }
 }
Ejemplo n.º 4
0
 public static void Show(string msj, bool showProgress = true)
 {
     Progress.Text            = msj;
     Progress.IsIndeterminate = showProgress;
     SystemTray.SetIsVisible(UIElement, true);
     SystemTray.SetProgressIndicator(UIElement, Progress);
     SystemTray.SetBackgroundColor(UIElement, ColorTranslator.FromHtml("#10283a"));
     SystemTray.SetForegroundColor(UIElement, ColorTranslator.FromHtml("#FFFFFF"));
 }
Ejemplo n.º 5
0
 public SettingsPage()
 {
     InitializeComponent();
     prog           = new ProgressIndicator();
     prog.IsVisible = true;
     SystemTray.SetProgressIndicator(this, prog);
     SystemTray.SetForegroundColor(this, App.Foreground_Color);
     SystemTray.SetBackgroundColor(this, Color.FromArgb(255, 101, 159, 130));
 }
Ejemplo n.º 6
0
 public Register()
 {
     InitializeComponent();
     prog           = new ProgressIndicator();
     prog.IsVisible = true;
     SystemTray.SetProgressIndicator(this, prog);
     SystemTray.SetBackgroundColor(this, Color.FromArgb(225, 220, 84, 82));
     SystemTray.SetForegroundColor(this, Colors.White);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Fancy UI to show progress of downloading map
 /// </summary>
 private void InitializeProgressIndicator()
 {
     SystemTray.SetIsVisible(this, true);
     SystemTray.SetOpacity(this, 0.5);
     SystemTray.SetBackgroundColor(this, Colors.Black);
     SystemTray.SetForegroundColor(this, Colors.White);
     prog = new ProgressIndicator();
     prog.IsIndeterminate = true;
     prog.IsVisible       = true;
     SystemTray.SetProgressIndicator(this, prog);
 }
Ejemplo n.º 8
0
        public ComposeEmail()
        {
            InitializeComponent();

            prog           = new ProgressIndicator();
            prog.IsVisible = true;
            prog.Text      = "Contacts";
            SystemTray.SetForegroundColor(this, App.Foreground_Color);
            SystemTray.SetBackgroundColor(this, Color.FromArgb(255, 62, 186, 210));
            SystemTray.SetProgressIndicator(this, prog);
        }
Ejemplo n.º 9
0
        public UserPage()
        {
            InitializeComponent();

            prog           = new ProgressIndicator();
            prog.IsVisible = true;
            SystemTray.SetProgressIndicator(this, prog);
            SystemTray.SetForegroundColor(this, Colors.White);
            SystemTray.SetBackgroundColor(this, Color.FromArgb(255, 50, 58, 69));
            item = new ContactModel();
        }
Ejemplo n.º 10
0
        public SearchPage()
        {
            InitializeComponent();
            ContactList.DataContext = App.ViewModel.ContactItems;
            settings                  = new AppSettings();
            settings.SearchItem       = "Full Name";
            txtNarrower.WatermarkText = "Narrow your search for: " + settings.SearchItem;

            tmpCollection = new List <ContactModel>();
            SystemTray.SetForegroundColor(this, App.Foreground_Color);
            SystemTray.SetBackgroundColor(this, App.Background_Color);
        }
Ejemplo n.º 11
0
        // Konstruktor
        public MainPage()
        {
            InitializeComponent();
            String titel = "CWS Informant";

#if LEHRER
            titel += " Lehrer";
#endif
#if DEBUG
            titel += " BETA";
#endif
            Pano.Title = titel;
            _pi        = new ProgressIndicator
            {
                IsVisible       = true,
                IsIndeterminate = true,
                Text            = "Vertretungen werden aktualisiert"
            };
            SystemTray.SetProgressIndicator(this, _pi);
            SystemTray.SetBackgroundColor(this, Color.FromArgb(225, 0, 31, 63));
            SystemTray.SetForegroundColor(this, Color.FromArgb(225, 221, 221, 221));
            _fetcher = new Fetcher();
            _fetcher.RaiseErrorMessage += (sender, e) =>
            {
                Alert(e.MessageHead, e.MessageBody, e.MessageButton);
            };
            _fetcher.RaiseRetreivedScheduleItems += (sender, e) =>
            {
                Refresh(e.Schedule);
            };

            if (_settings.Read("oldDb1") != null)
            {
                _vertr1 = (ObservableCollection <Data>)_settings.Read("oldDb1");
            }
            else
            {
                _vertr1.Add(new Data());
            }
            if (_settings.Read("oldDb2") != null)
            {
                _vertr2 = (ObservableCollection <Data>)_settings.Read("oldDb2");
            }
            if (_settings.Read("oldDb1Tit") != null)
            {
                Agenda1.Header = (String)_settings.Read("oldDb1Tit");
            }
            if (_settings.Read("oldDb2Tit") != null)
            {
                Agenda2.Header = (String)_settings.Read("oldDb2Tit");
            }
            SetPanoItems();
        }
Ejemplo n.º 12
0
        private void OnRootFrameNavigated(object sender, NavigationEventArgs e)
        {
            // Use in Mango to share a single progress indicator instance.
            var ee = e.Content;

            _page = ee as PhoneApplicationPage;
            if (_page != null)
            {
                SystemTray.SetBackgroundColor(_page, Color.FromArgb(255, 240, 249, 255));
                SystemTray.SetForegroundColor(_page, Color.FromArgb(255, 31, 117, 204));
                _page.SetValue(SystemTray.OpacityProperty, 0.99);
                _page.SetValue(SystemTray.ProgressIndicatorProperty, _mangoIndicator);
            }
        }
Ejemplo n.º 13
0
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the LongListSelector control to the sample data
            DataContext = App.ViewModel;
            Color currentAccentColorHex =
                (Color)Application.Current.Resources["PhoneAccentColor"];

            SystemTray.SetBackgroundColor(this, Color.FromArgb(255, 202, 98, 89));
            SystemTray.SetForegroundColor(this, Colors.White);


            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
        }
Ejemplo n.º 14
0
            private void SetSystemComponentColors(PhoneApplicationPage page, Color background, Color foreground, Color chrome)
            {
                if (page != null)
                {
                    SystemTray.SetBackgroundColor(page, background);
                    SystemTray.SetForegroundColor(page, foreground);

                    if (OverrideOptions == ThemeManagerOverrideOptions.SystemTrayAndApplicationBars)
                    {
                        var appBar = page.ApplicationBar as IApplicationBar;
                        if (appBar != null)
                        {
                            appBar.MatchOverriddenTheme();
                        }
                    }
                }
            }
Ejemplo n.º 15
0
        public void Set(Color?bg, Color?fg, double?op)
        {
            if (bg.HasValue)
            {
                SystemTray.SetBackgroundColor(managedPage, bg.Value);
            }

            if (fg.HasValue)
            {
                SystemTray.SetForegroundColor(managedPage, fg.Value);
            }

            if (op.HasValue)
            {
                SystemTray.SetOpacity(managedPage, op.Value);
            }
        }
Ejemplo n.º 16
0
        public MainPage()
        {
            InitializeComponent();

            SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape;

            global::Xamarin.Forms.Forms.Init();

            KingTranslator.App.TranslatorManager = new TranslatorItemManager(Translator.Default);

            LoadApplication(new KingTranslator.App());

            SystemTray.SetProgressIndicator(this, new ProgressIndicator()
            {
                Text = "King Translator", IsVisible = true
            });
            SystemTray.SetBackgroundColor(this, ((System.Windows.Media.SolidColorBrush)System.Windows.Application.Current.Resources["Brush1"]).Color);
        }
Ejemplo n.º 17
0
        public MainPage()
        {
            InitializeComponent();
            App.FirstVisit = true;
            SetGlobalColors();
            InitAppBars();
            recentList.ItemsSource = App.RecentList;



            prog           = new ProgressIndicator();
            prog.IsVisible = true;
            SystemTray.SetForegroundColor(this, App.Foreground_Color);
            SystemTray.SetBackgroundColor(this, App.Background_Color);
            SystemTray.SetProgressIndicator(this, prog);
            settings = new AppSettings();

            ModelView model = new ModelView();

            App.ViewModel = model;
        }
Ejemplo n.º 18
0
    void activateProgressIndicator()
    {
        // In theory, you should not need to use Dispatcher here with async/await.
        // But without a complete code example, it's impossible for me to
        // say for sure, so I've left it as-is.
        Deployment.Current.Dispatcher.BeginInvoke(() =>
        {
            var currentPage = App.RootFrame.Content as PhoneApplicationPage;
            SystemTray.SetIsVisible(currentPage, true);
            SystemTray.SetOpacity(currentPage, 0.5);
            SystemTray.SetBackgroundColor(currentPage, Colors.White);
            SystemTray.SetForegroundColor(currentPage, Colors.Black);

            progressIndicator                 = new ProgressIndicator();
            progressIndicator.IsVisible       = true;
            progressIndicator.IsIndeterminate = true;
            progressIndicator.Text            = message;

            SystemTray.SetProgressIndicator(currentPage, progressIndicator);
        });
    }
Ejemplo n.º 19
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            SystemTray.SetBackgroundColor(this, Color.FromArgb(255, 24, 22, 22));
            SystemTray.SetForegroundColor(this, Color.FromArgb(255, 255, 255, 254));
            base.OnNavigatedTo(e);
            string id = "";

            if (NavigationContext.QueryString.TryGetValue("id", out id))
            {
                _vm = new NewsPageViewModel {
                    News = App.MainViewModel.NewsPage.NewsList.Where(n => n.Model.Id == id).FirstOrDefault()
                };
                if (_vm == null)
                {
                    MessageBox.Show("Error", "Can't find news", MessageBoxButton.OK);
                    NavigationService.GoBack();
                }
                _vm.PropertyChanged += _vm_PropertyChanged;
                _vm.Load(id);
            }
            DataContext = _vm;
        }
Ejemplo n.º 20
0
        public Login()
        {
            prog           = new ProgressIndicator();
            prog.IsVisible = true;

            InitializeComponent();
            if (App.User == null)
            {
                //string result = ServiceManager.DecryptPasscode("Bread");
                // if (result != null)
                //{
                //    prog.Text = "Signing In...";
                //    SignUserIn(null, null, result);
                //    SignedIn = true;
                //}
            }

            #region SystemTray

            SystemTray.SetForegroundColor(this, Colors.White);
            SystemTray.SetBackgroundColor(this, Color.FromArgb(255, 49, 134, 179));
            SystemTray.SetProgressIndicator(this, prog);
            #endregion
        }
Ejemplo n.º 21
0
 public void Reset()
 {
     SystemTray.SetBackgroundColor(managedPage, background);
     SystemTray.SetForegroundColor(managedPage, foreground);
     SystemTray.SetOpacity(managedPage, opacity);
 }
Ejemplo n.º 22
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();


            #region trial Check
            if (App.IsTrial == true)
            {
                // enable ads
                adControl.Visibility = System.Windows.Visibility.Visible;
                //adControl.IsAutoRefreshEnabled = true;
                adControl.IsEnabled             = true;
                adControl.IsAutoCollapseEnabled = false;
            }
            else
            {
                // disables ads
                adControl.Visibility = System.Windows.Visibility.Collapsed;
                //adControl.IsAutoRefreshEnabled = false;
                adControl.IsEnabled             = false;
                adControl.IsAutoCollapseEnabled = false;
            }
            #endregion


            OrientationChanged += new EventHandler <OrientationChangedEventArgs>(MainPage_OrientationChanged);

            // initially check
            PageOrientation po = this.Orientation;
            if (po == PageOrientation.Portrait || po == PageOrientation.PortraitDown || po == PageOrientation.PortraitUp)
            {
                // return pivot to original position
                MapHeight           = 800;
                MainPivot.Margin    = new Thickness(0, 125, 0, 0);
                AllPivot.Header     = "all";
                FreewayPivot.Header = "highways";
                RoadPivot.Header    = "roads";

                // this.ApplicationBar.IsVisible = this.ApplicationBar.IsVisible;
            }
            else if (po == PageOrientation.Landscape || po == PageOrientation.LandscapeLeft || po == PageOrientation.LandscapeRight)
            {
                // hiding pivot header in landscape mode
                MapHeight           = 480;
                MainPivot.Margin    = new Thickness(0, 30, 0, 0);
                AllPivot.Header     = "";
                FreewayPivot.Header = "";
                RoadPivot.Header    = "";
                //    this.ApplicationBar.IsVisible = !this.ApplicationBar.IsVisible;
            }



            isolatedStorageSettings = IsolatedStorageSettings.ApplicationSettings;


            // disable lock screen timer
            Microsoft.Phone.Shell.PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;

            // References:
            // http://weblogs.asp.net/scottgu/archive/2010/03/18/building-a-windows-phone-7-twitter-application-using-silverlight.aspx
            // http://msdn.microsoft.com/en-us/library/hh441726.aspx
            // http://json.codeplex.com
            // Bing Maps REST Services API Reference: http://msdn.microsoft.com/en-us/library/ff701722.aspx
            // Adding Tile Layers (overlays) http://msdn.microsoft.com/en-us/library/ee681902.aspx

            wc = new WebClient();
            wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(REST_traffic);
            //wc.DownloadStringAsync(new Uri("http://dev.virtualearth.net/REST/v1/Traffic/Incidents/37,-105,45,-94?key=" + Id));

            // caching
            Current_Location.CacheMode = new BitmapCache();
            mMap.ZoomLevel             = 10;
            //mMap.ZoomBarVisibility = System.Windows.Visibility.Visible;
            Current_Location.Style          = (Style)(Application.Current.Resources["PushpinStyle"]);
            Current_Location.PositionOrigin = PositionOrigin.Center;

            MyPreviousLocation.X = 0; MyPreviousLocation.Y = 0;
            #region Progress Indicator
            SystemTray.SetIsVisible(this, true);
            SystemTray.SetOpacity(this, 0.5);
            SystemTray.SetBackgroundColor(this, Colors.Black);
            SystemTray.SetForegroundColor(this, Colors.White);
            prog = new ProgressIndicator();
            prog.IsIndeterminate = true;
            prog.IsVisible       = true;
            SystemTray.SetProgressIndicator(this, prog);

            #endregion
        }