Exemple #1
0
        ///SingleBinding.ReloadMainPage

        public async Task Load_BandData()
        {
            IBandInfo Band_Found = await BandHandler.Get_Band();

            if (Band_Found == null)
            {
                Disable_BandFeatures();
                return;
            }



            #region Setup BandData

            if (App._CustomBandThemes == null || App._CustomBandThemes.Count == 0)
            {
                OneMomentDetails.Text  = Localization.Get_Text(Localization.Tag.Band_, "GetDetails1");
                App.OverlayApp.Overlay = true;


                #region Gets and sets the meTile
                App._MeImageTile = await Core.BandHandler.Get_Image(); /// Gets the band metile form the band

                BandPreview.SetImage(App._MeImageTile);                /// Sets the image of the previewControl
                PreviewImage.Source = App._MeImageTile;                /// Sets the image of the tapp to change control
                #endregion
                #region Gets and sets the Theme
                BandTheme tempBandTheme = await Core.BandHandler.Get_Theme(); /// Gets the current theme on the band

                BandPreview.SetTheme(tempBandTheme);                          /// Sets the preview theme as the current
                App._CurrentBandTheme  = tempBandTheme;                       /// Sets the retrieved teme as the current
                App._SelectedBandTheme = 0;                                   /// Sets the selected as 0 since the control now contains a theme. If this is not set the applicaiton will not work correctly. Possible issue of .20 -> .25 issue. Caused rewrite of this task
                App._CustomBandThemes  = await ReturnProfiles();              /// Gets the custom profiles created by user from storage.

                #endregion

                App.BandGeneration = await BandHandler.Get_BandGeneration(); /// Gets the current band generation possible values -1, 1, 2

                App.OverlayApp.Overlay = false;
            }
            else
            {
                App._CurrentBandTheme = App._CustomBandThemes[App._SelectedBandTheme].Theme;
                BandPreview.SetImage(App._MeImageTile);
                BandPreview.SetTheme(App._CurrentBandTheme);

                PreviewImage.Source = App._MeImageTile;

                Profile_Selector.SelectedIndex = App._SelectedBandTheme;

                App.ViewModel.Items.ElementAt(App._SelectedBandTheme).LineNine = "#" + await Parse._ColorToHEX(App._CurrentBandTheme.Base.ToColor());

                App.ViewModel.Items.ElementAt(App._SelectedBandTheme).LineTen = "#" + await Parse._ColorToHEX(App._CurrentBandTheme.HighContrast.ToColor());
            }

            FillBase.Fill         = new SolidColorBrush(App._CurrentBandTheme.Base.ToColor());
            FillHighContrast.Fill = new SolidColorBrush(App._CurrentBandTheme.HighContrast.ToColor());

            #endregion
        }
Exemple #2
0
        private async void Profile_Selector_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int index = ((ComboBox)sender).SelectedIndex;

            if (index == 0)
            {
                ProfileEdit_AppBarButton.IsEnabled   = false;
                ProfileDelete_AppBarButton.IsEnabled = false;
            }
            else if (index == -1)
            {
                return;
            }
            else
            {
                ProfileEdit_AppBarButton.IsEnabled   = true;
                ProfileDelete_AppBarButton.IsEnabled = true;
            }

            /*if (index == 0)
             * {
             *
             *  /// Normal Execution here, due to current theme on band
             *  ///
             *  App._SelectedBandTheme = index;
             * }
             * else
             * {
             *  //int ProfileIndex = index - 1; /// This is due to index will always be 1 or more. Array will always start with 0. int = index - 1 is required
             *  App._SelectedBandTheme = index; //ProfileIndex;
             *  //_SelectedTheme = App._CustomBandThemes[ProfileIndex].Theme;
             *  ///Specified execution here, due to timed or manual theme here.
             * }*/
            //FillBase.Fill = new SolidColorBrush(_SelectedTheme.Base.ToColor());
            //FillHighContrast.Fill = new SolidColorBrush(_SelectedTheme.HighContrast.ToColor());

            App._SelectedBandTheme = index;

            if (App.OverlayApp.Overlay == false && App._CustomBandThemes != null)
            {
                App._CurrentBandTheme = App._CustomBandThemes[App._SelectedBandTheme].Theme;
                BandPreview.SetImage(App._MeImageTile);
                BandPreview.SetTheme(App._CurrentBandTheme);

                FillBase.Fill         = new SolidColorBrush(App._CurrentBandTheme.Base.ToColor());
                FillHighContrast.Fill = new SolidColorBrush(App._CurrentBandTheme.HighContrast.ToColor());
            }
        }