private void GenerateOptions(string title, string[] childrenKeys)
        {
            TextBlock tb1 = new TextBlock();

            BlueStacksUIBinding.Bind(tb1, title, "");
            tb1.Padding  = new Thickness(0.0);
            tb1.FontSize = 16.0;
            tb1.Margin   = new Thickness(0.0, 10.0, 0.0, 0.0);
            BlueStacksUIBinding.BindColor((DependencyObject)tb1, Control.ForegroundProperty, "SettingsWindowTabMenuItemSelectedForeground");
            tb1.FontWeight          = FontWeights.Normal;
            tb1.HorizontalAlignment = HorizontalAlignment.Left;
            tb1.VerticalAlignment   = VerticalAlignment.Center;
            this.mOptionsStackPanel.Children.Add((UIElement)tb1);
            foreach (string childrenKey in childrenKeys)
            {
                CustomRadioButton tb2 = new CustomRadioButton();
                tb2.Checked            += new RoutedEventHandler(this.Btn_Checked);
                tb2.HorizontalAlignment = HorizontalAlignment.Left;
                BlueStacksUIBinding.Bind(tb2, childrenKey);
                tb2.Tag    = (object)childrenKey;
                tb2.Margin = new Thickness(0.0, 10.0, 0.0, 5.0);
                this.mOptionsStackPanel.Children.Add((UIElement)tb2);
                if (childrenKey == this.mCurrentGlobalDefault)
                {
                    tb2.IsChecked = new bool?(true);
                }
            }
        }
Example #2
0
        private void CreateShortcutCategory(string categoryName)
        {
            if (this.mShortcutUIElements.ContainsKey(categoryName))
            {
                return;
            }
            string   localizedString = LocaleStrings.GetLocalizedString(categoryName, "");
            GroupBox groupBox1       = new GroupBox();

            groupBox1.Content  = (object)new StackPanel();
            groupBox1.Header   = (object)localizedString;
            groupBox1.Tag      = (object)categoryName;
            groupBox1.Margin   = new Thickness(0.0, 20.0, 0.0, 0.0);
            groupBox1.FontSize = 16.0;
            GroupBox groupBox2 = groupBox1;

            BlueStacksUIBinding.BindColor((DependencyObject)groupBox2, Control.ForegroundProperty, "SettingsWindowTabMenuItemLegendForeground");
            groupBox2.BorderThickness = new Thickness(0.0);
            TextBlock textBlock = new TextBlock();

            textBlock.Text                = localizedString;
            textBlock.Tag                 = (object)categoryName;
            textBlock.FontStretch         = FontStretches.ExtraExpanded;
            textBlock.HorizontalAlignment = HorizontalAlignment.Center;
            textBlock.Margin              = new Thickness(0.0, 0.0, 0.0, 10.0);
            textBlock.TextWrapping        = TextWrapping.WrapWithOverflow;
            BlueStacksUIBinding.BindColor((DependencyObject)textBlock, TextBlock.ForegroundProperty, "SettingsWindowTabMenuItemLegendForeground");
            this.mShortcutUIElements.Add(categoryName, new BlueStacks.Common.Tuple <GroupBox, List <ShortcutKeyControlElement> >(groupBox2, new List <ShortcutKeyControlElement>()));
        }
Example #3
0
 private void ChooseNewGrid_MouseEnter(object sender, MouseEventArgs e)
 {
     if (!RegistryManager.Instance.IsPremium)
     {
         this.mWallpaperPopup.IsOpen = true;
     }
     BlueStacksUIBinding.BindColor((DependencyObject)(sender as Grid), Panel.BackgroundProperty, "ContextMenuItemBackgroundHoverColor");
 }
Example #4
0
 private void SetDefaultGrid_MouseEnter(object sender, MouseEventArgs e)
 {
     if (!File.Exists(HomeAppManager.BackgroundImagePath))
     {
         return;
     }
     BlueStacksUIBinding.BindColor((DependencyObject)(sender as Grid), Panel.BackgroundProperty, "ContextMenuItemBackgroundHoverColor");
 }
Example #5
0
 private void Button_MouseLeave(object sender, MouseEventArgs e)
 {
     if (this.IsSelected)
     {
         return;
     }
     BlueStacksUIBinding.BindColor((DependencyObject)this.mBottomGrid, Panel.BackgroundProperty, "HomeAppTabBackgroundColor");
     BlueStacksUIBinding.BindColor((DependencyObject)this.mTabHeader, TextBlock.ForegroundProperty, "HomeAppTabForegroundColor");
 }
Example #6
0
 private bool TestEmail(string text)
 {
     BlueStacksUIBinding.BindColor((DependencyObject)this.txtEmailBorder, Border.BorderBrushProperty, "SettingsWindowTabMenuItemForeground");
     if (Regex.IsMatch(text, "^(?(\")(\".+?(?<!\\\\)\"@)|(([0-9a-z]((\\.(?!\\.))|[-!#\\$%&'\\*\\+/=\\?\\^`\\{\\}\\|~\\w])*)(?<=[0-9a-z])@))(?(\\[)(\\[(\\d{1,3}\\.){3}\\d{1,3}\\])|(([0-9a-z][-0-9a-z]*[0-9a-z]*\\.)+[a-z0-9][\\-a-z0-9]{0,22}[a-z0-9]))$", RegexOptions.IgnoreCase))
     {
         return(true);
     }
     this.txtEmailBorder.BorderBrush = (Brush)Brushes.Red;
     return(false);
 }
 private void mYesBtn_Click(object sender, RoutedEventArgs e)
 {
     BlueStacksUIBinding.BindColor((DependencyObject)this.mYesBtn, Control.BackgroundProperty, "BlueMouseDownBorderBackground");
     BlueStacks.Common.Stats.SendCommonClientStatsAsync("notification_mode", "exitpopup_yes", this.ParentWindow.mVmName, "", "", "", "");
     this.ParentWindow.EngineInstanceRegistry.IsMinimizeSelectedOnReceiveGameNotificationPopup = true;
     RegistryManager.Instance.IsNotificationModeAlwaysOn = true;
     NotificationManager.Instance.UpdateMuteState(MuteState.NotMuted, new JsonParser(this.ParentWindow.mVmName).GetAppNameFromPackage(this.PackageName), this.ParentWindow.mVmName);
     this.Close();
     this.ParentWindow.MinimizeWindowHandler();
 }
Example #8
0
 private bool TestPhone(string text)
 {
     BlueStacksUIBinding.BindColor((DependencyObject)this.txtPhoneBorder, Border.BorderBrushProperty, "SettingsWindowTabMenuItemForeground");
     if (Regex.IsMatch(text, OtsFeedbackControl.MakeCombinedPattern((IEnumerable <string>)OtsFeedbackControl.m_Phone_Patterns), RegexOptions.IgnoreCase))
     {
         return(true);
     }
     this.txtPhoneBorder.BorderBrush = (Brush)Brushes.Red;
     return(false);
 }
Example #9
0
 private void Image_MouseLeave(object sender, MouseEventArgs e)
 {
     if (KMManager.sDragCanvasElement == null)
     {
         this.Cursor = Cursors.Arrow;
     }
     this.mDragImage.Visibility = Visibility.Hidden;
     BlueStacksUIBinding.BindColor((DependencyObject)this.mBorder, Control.BorderBrushProperty, "AdvancedSettingsItemPanelBorder");
     this.mBorder.Effect = (Effect)null;
 }
Example #10
0
 private void KeyPropertyNameTextBox_LostFocus(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrEmpty(this.mKeyPropertyNameTextBox.Text))
     {
         return;
     }
     this.mKeyPropertyNameTextBox.Text       = LocaleStrings.GetLocalizedString("STRING_ENTER_GUIDANCE_TEXT", "");
     this.mKeyPropertyNameTextBox.FontStyle  = FontStyles.Italic;
     this.mKeyPropertyNameTextBox.FontWeight = FontWeights.ExtraLight;
     BlueStacksUIBinding.BindColor((DependencyObject)this.mKeyPropertyNameTextBox, Control.ForegroundProperty, "DualTextBlockLightForegroundColor");
 }
Example #11
0
 private void KeyPropertyNameTextBox_GotFocus(object sender, RoutedEventArgs e)
 {
     if (!string.Equals(LocaleStrings.GetLocalizedString("STRING_ENTER_GUIDANCE_TEXT", ""), this.mKeyPropertyNameTextBox.Text, StringComparison.InvariantCulture))
     {
         return;
     }
     this.mKeyPropertyNameTextBox.Text       = "";
     this.mKeyPropertyNameTextBox.FontStyle  = FontStyles.Normal;
     this.mKeyPropertyNameTextBox.FontWeight = FontWeights.Normal;
     BlueStacksUIBinding.BindColor((DependencyObject)this.mKeyPropertyNameTextBox, Control.ForegroundProperty, "DualTextBlockForeground");
 }
Example #12
0
 private void OpenSearchSuggestions()
 {
     try
     {
         if (this.mSearchRecommendationBorder.Visibility == Visibility.Visible || !string.IsNullOrEmpty(this.mSearchTextBox.Text) && !(this.mSearchTextBox.Text == this.defaultSearchBoxText) || (PromotionObject.Instance.SearchRecommendations.Count <= 0 || !this.mIsShowSearchRecommendations))
         {
             return;
         }
         this.searchRecomItems.Children.Clear();
         Separator separator1 = new Separator();
         separator1.Margin = new Thickness(0.0);
         separator1.Style  = this.FindResource((object)ToolBar.SeparatorStyleKey) as Style;
         Separator separator2 = separator1;
         BlueStacksUIBinding.BindColor((DependencyObject)separator2, Control.BackgroundProperty, "VerticalSeparator");
         this.searchRecomItems.Children.Add((UIElement)separator2);
         Label label1 = new Label();
         label1.Content = (object)LocaleStrings.GetLocalizedString("STRING_MOST_SEARCHED_APPS", "");
         Label label2 = label1;
         BlueStacksUIBinding.BindColor((DependencyObject)label2, Control.ForegroundProperty, "SearchGridForegroundColor");
         label2.FontSize = 14.0;
         label2.Padding  = new Thickness(10.0, 5.0, 5.0, 5.0);
         this.searchRecomItems.Children.Add((UIElement)label2);
         foreach (KeyValuePair <string, SearchRecommendation> searchRecommendation in (Dictionary <string, SearchRecommendation>)PromotionObject.Instance.SearchRecommendations)
         {
             RecommendedAppItem recommendedAppItem = new RecommendedAppItem();
             recommendedAppItem.Populate(this.ParentWindow, searchRecommendation.Value);
             recommendedAppItem.Padding = new Thickness(5.0, 0.0, 0.0, 0.0);
             this.searchRecomItems.Children.Add((UIElement)recommendedAppItem);
         }
         Border       recommendationBorder = this.mSearchRecommendationBorder;
         CornerRadius cornerRadius1        = this.searchTextBoxBorder.CornerRadius;
         double       bottomRight          = cornerRadius1.BottomRight;
         cornerRadius1 = this.searchTextBoxBorder.CornerRadius;
         double       bottomLeft    = cornerRadius1.BottomLeft;
         CornerRadius cornerRadius2 = new CornerRadius(0.0, 0.0, bottomRight, bottomLeft);
         recommendationBorder.CornerRadius = cornerRadius2;
         Border mask = this.Mask;
         cornerRadius1 = this.searchTextBoxBorder.CornerRadius;
         CornerRadius cornerRadius3 = new CornerRadius(0.0, cornerRadius1.TopRight, 0.0, 0.0);
         mask.CornerRadius = cornerRadius3;
         Border searchTextBoxBorder = this.searchTextBoxBorder;
         cornerRadius1 = this.searchTextBoxBorder.CornerRadius;
         double topLeft = cornerRadius1.TopLeft;
         cornerRadius1 = this.searchTextBoxBorder.CornerRadius;
         double       topRight      = cornerRadius1.TopRight;
         CornerRadius cornerRadius4 = new CornerRadius(topLeft, topRight, 0.0, 0.0);
         searchTextBoxBorder.CornerRadius            = cornerRadius4;
         this.mSearchRecommendationBorder.Visibility = Visibility.Visible;
     }
     catch (Exception ex)
     {
         Logger.Error("Exception when trying to open search recommendations. " + ex.ToString());
     }
 }
 private void ComboBoxItem_MouseLeave(object sender, MouseEventArgs e)
 {
     if (this.mSchemeName.Text != this.CanvasWindow.SidebarWindow.mSchemeComboBox.SelectedItem)
     {
         BlueStacksUIBinding.BindColor((DependencyObject)this, Control.BackgroundProperty, "ComboBoxBackgroundColor");
     }
     else
     {
         BlueStacksUIBinding.BindColor((DependencyObject)this, Control.BackgroundProperty, "ContextMenuItemBackgroundSelectedColor");
     }
 }
        private void AddLineSeperator()
        {
            Border border1 = new Border();

            border1.Opacity = 0.5;
            border1.Height  = 1.0;
            border1.Margin  = new Thickness(0.0, 10.0, 0.0, 0.0);
            Border border2 = border1;

            BlueStacksUIBinding.BindColor((DependencyObject)border2, Border.BackgroundProperty, "SettingsWindowTabMenuItemForeground");
            this.mOptionsStackPanel.Children.Add((UIElement)border2);
        }
Example #15
0
 private void SearchTextBox_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
 {
     if (this.ParentWindow.mWelcomeTab.IsPromotionVisible)
     {
         return;
     }
     if (this.mSearchTextBox.Text == this.defaultSearchBoxText)
     {
         this.mSearchTextBox.Text = string.Empty;
     }
     this.OpenSearchSuggestions();
     BlueStacksUIBinding.BindColor((DependencyObject)this.mSearchTextBox, Control.ForegroundProperty, "SearchGridForegroundFocusedColor");
 }
        public void UpdateNotificationCount()
        {
            SerializableDictionary <string, GenericNotificationItem> notificationItems = GenericNotificationManager.GetNotificationItems((Predicate <GenericNotificationItem>)(x => !x.IsDeleted && !x.IsRead && string.Equals(x.VmName, this.ParentWindow.mVmName, StringComparison.InvariantCulture)));

            if (notificationItems.Count > 0 && !this.ParentWindow.mTopBar.mNotificationCentrePopup.IsOpen)
            {
                Border border1 = new Border();
                border1.VerticalAlignment = VerticalAlignment.Center;
                border1.Height            = 14.0;
                border1.MaxWidth          = 24.0;
                Border    border2    = border1;
                TextBlock textBlock1 = new TextBlock();
                textBlock1.Text                = notificationItems.Count.ToString((IFormatProvider)CultureInfo.InvariantCulture);
                textBlock1.FontSize            = 10.0;
                textBlock1.MaxWidth            = 24.0;
                textBlock1.FontWeight          = FontWeights.Bold;
                textBlock1.VerticalAlignment   = VerticalAlignment.Center;
                textBlock1.HorizontalAlignment = HorizontalAlignment.Center;
                textBlock1.Padding             = new Thickness(3.0, 0.0, 3.0, 1.0);
                TextBlock textBlock2 = textBlock1;
                if (notificationItems.Count > 99)
                {
                    textBlock2.Text = "99+";
                }
                BlueStacksUIBinding.BindColor((DependencyObject)textBlock2, Control.ForegroundProperty, "SettingsWindowTitleBarForeGround");
                BlueStacksUIBinding.BindColor((DependencyObject)border2, Control.BackgroundProperty, "XPackPopupColor");
                border2.CornerRadius = new CornerRadius(7.0);
                border2.Child        = (UIElement)textBlock2;
                Canvas.SetLeft((UIElement)border2, 20.0);
                Canvas.SetTop((UIElement)border2, 9.0);
                if (this.ParentWindow.mTopBar.mNotificationCountBadge == null)
                {
                    return;
                }
                if (GenericNotificationManager.GetNotificationItems((Predicate <GenericNotificationItem>)(x => !x.IsRead && !x.IsDeleted && x.Priority == NotificationPriority.Important)).Count > 0)
                {
                    this.ParentWindow.mTopBar.mNotificationCountBadge.Visibility = Visibility.Collapsed;
                }
                else
                {
                    this.ParentWindow.mTopBar.mNotificationCountBadge.Visibility = Visibility.Visible;
                }
                this.ParentWindow.mTopBar.mNotificationCountBadge.Children.Clear();
                this.ParentWindow.mTopBar.mNotificationCountBadge.Children.Add((UIElement)border2);
            }
            else
            {
                this.ParentWindow.mTopBar.mNotificationCountBadge.Visibility = Visibility.Collapsed;
            }
        }
 public void AddSkinImages()
 {
     try
     {
         this.ThemesDrawer.Children.Clear();
         foreach (string directory in Directory.GetDirectories(RegistryManager.Instance.ClientInstallDir))
         {
             if (File.Exists(Path.Combine(directory, "ThemeThumbnail.png")))
             {
                 string themeName = BlueStacksUIColorManager.GetThemeName(directory);
                 SkinSelectorControl skinSelectorControl1 = new SkinSelectorControl();
                 skinSelectorControl1.Visibility          = Visibility.Visible;
                 skinSelectorControl1.HorizontalAlignment = HorizontalAlignment.Center;
                 skinSelectorControl1.VerticalAlignment   = VerticalAlignment.Top;
                 SkinSelectorControl skinSelectorControl2 = skinSelectorControl1;
                 skinSelectorControl2.mThemeImage.Visibility      = Visibility.Visible;
                 skinSelectorControl2.mThemeName.Visibility       = Visibility.Visible;
                 skinSelectorControl2.mThemeImage.IsFullImagePath = true;
                 skinSelectorControl2.mThemeImage.ImageName       = Path.Combine(directory, "ThemeThumbnail.png");
                 skinSelectorControl2.mThemeCheckButton.Height    = 30.0;
                 skinSelectorControl2.mThemeName.ToolTip          = (object)themeName;
                 skinSelectorControl2.mThemeName.Width            = double.NaN;
                 skinSelectorControl2.mThemeCheckButton.Width     = double.NaN;
                 skinSelectorControl2.mThemeName.Text             = themeName;
                 BlueStacksUIBinding.BindColor((DependencyObject)skinSelectorControl2.mThemeName, TextBlock.ForegroundProperty, "ContextMenuItemForegroundColor");
                 skinSelectorControl2.mThemeCheckButton.Tag    = (object)Path.GetFileName(directory);
                 skinSelectorControl2.mThemeCheckButton.Click += new RoutedEventHandler(this.ThemeApplyButton_Click);
                 if (string.Compare(RegistryManager.ClientThemeName, Path.GetFileName(directory), StringComparison.OrdinalIgnoreCase) == 0)
                 {
                     skinSelectorControl2.mThemeAppliedText.Text       = LocaleStrings.GetLocalizedString("STRING_APPLIED", "");
                     skinSelectorControl2.mThemeAppliedText.Visibility = Visibility.Visible;
                     skinSelectorControl2.mThemeAppliedText.Margin     = new Thickness(0.0, 3.0, 4.0, 0.0);
                 }
                 else
                 {
                     skinSelectorControl2.mThemeCheckButton.ButtonColor = ButtonColors.Blue;
                     skinSelectorControl2.mThemeCheckButton.IsEnabled   = true;
                     skinSelectorControl2.mThemeCheckButton.Content     = (object)LocaleStrings.GetLocalizedString("STRING_APPLY", "");
                     skinSelectorControl2.mThemeCheckButton.Visibility  = Visibility.Visible;
                 }
                 this.ThemesDrawer.Children.Add((UIElement)skinSelectorControl2);
                 this.mThemesDrawerScrollBar.Visibility = Visibility.Visible;
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Error in populating themes in skin widget " + ex.ToString());
     }
 }
Example #18
0
 private void Image_MouseEnter(object sender, MouseEventArgs e)
 {
     this.Cursor = Cursors.Hand;
     this.mDragImage.Visibility = Visibility.Visible;
     BlueStacksUIBinding.BindColor((DependencyObject)this.mBorder, Control.BorderBrushProperty, "AdvancedGameControlHeaderBackgroundColor");
     this.mBorder.Effect = (Effect) new DropShadowEffect()
     {
         Direction   = 270.0,
         ShadowDepth = 3.0,
         BlurRadius  = 12.0,
         Opacity     = 0.75,
         Color       = ((SolidColorBrush)this.mBorder.Background).Color
     };
 }
Example #19
0
 private void Grid_MouseLeave(object sender, MouseEventArgs e)
 {
     (sender as Grid).Background = (Brush)Brushes.Transparent;
     foreach (UIElement child in (sender as Grid).Children)
     {
         if (child is CustomPictureBox)
         {
             (child as CustomPictureBox).ImageName = (child as CustomPictureBox).ImageName.Replace("_hover", "");
         }
         if (child is TextBlock)
         {
             BlueStacksUIBinding.BindColor((DependencyObject)(child as TextBlock), Control.ForegroundProperty, "SettingsWindowTabMenuItemForeground");
         }
     }
 }
Example #20
0
 private void Grid_MouseEnter(object sender, MouseEventArgs e)
 {
     BlueStacksUIBinding.BindColor((DependencyObject)(sender as Grid), Panel.BackgroundProperty, "ContextMenuItemBackgroundHoverColor");
     foreach (UIElement child in (sender as Grid).Children)
     {
         if (child is CustomPictureBox)
         {
             (child as CustomPictureBox).ImageName = (child as CustomPictureBox).ImageName + "_hover";
         }
         if (child is TextBlock)
         {
             BlueStacksUIBinding.BindColor((DependencyObject)(child as TextBlock), Control.ForegroundProperty, "SettingsWindowTabMenuItemSelectedForeground");
         }
     }
 }
Example #21
0
        internal void ImportSchemes(
            List <IMControlScheme> toCopyFromSchemes,
            Dictionary <string, Dictionary <string, string> > stringsToImport)
        {
            bool flag1 = false;
            bool flag2 = false;

            KMManager.MergeConflictingGuidanceStrings(this.ParentWindow.SelectedConfig, toCopyFromSchemes, stringsToImport);
            if (this.ParentWindow.SelectedConfig.ControlSchemes.Count > 0)
            {
                flag1 = true;
            }
            foreach (IMControlScheme toCopyFromScheme in toCopyFromSchemes)
            {
                IMControlScheme imControlScheme = toCopyFromScheme.DeepCopy();
                if (flag1)
                {
                    imControlScheme.Selected = false;
                }
                imControlScheme.BuiltIn      = false;
                imControlScheme.IsBookMarked = false;
                this.CanvasWindow.SidebarWindow.mSchemeComboBox.mName.Text = imControlScheme.Name;
                this.ParentWindow.SelectedConfig.ControlSchemes.Add(imControlScheme);
                this.ParentWindow.SelectedConfig.ControlSchemesDict.Add(imControlScheme.Name, imControlScheme);
                ComboBoxSchemeControl boxSchemeControl = new ComboBoxSchemeControl(this.CanvasWindow, this.ParentWindow);
                boxSchemeControl.mSchemeName.Text = LocaleStrings.GetLocalizedString(imControlScheme.Name, "");
                boxSchemeControl.IsEnabled        = true;
                BlueStacksUIBinding.BindColor((DependencyObject)boxSchemeControl, Control.BackgroundProperty, "ComboBoxBackgroundColor");
                this.CanvasWindow.SidebarWindow.mSchemeComboBox.Items.Children.Add((UIElement)boxSchemeControl);
            }
            if (flag1)
            {
                return;
            }
            foreach (IMControlScheme controlScheme in this.ParentWindow.SelectedConfig.ControlSchemes)
            {
                if (controlScheme.Selected)
                {
                    flag2 = true;
                    break;
                }
            }
            if (flag2)
            {
                return;
            }
            this.ParentWindow.SelectedConfig.ControlSchemes[0].Selected = true;
        }
 public UninstallFinish()
 {
     this.InitializeComponent();
     if (!Oem.IsOEMDmm)
     {
         return;
     }
     this.Height = 100.0;
     this.mUninstallFinishedLabel.FontSize = 12.5;
     this.mUninstallFinishedLabel.Margin   = new Thickness(-100.0, 15.0, 0.0, 0.0);
     this.mThankLabel.FontSize             = 12.5;
     this.mThankLabel.Margin          = new Thickness(-90.0, 10.0, 0.0, 30.0);
     this.mUninstallFinished.FontSize = 20.0;
     this.mUninstallFinished.Margin   = new Thickness(-45.0, 0.0, 0.0, 15.0);
     BlueStacksUIBinding.BindColor((DependencyObject)this.mUninstallFinishedLabel, Control.ForegroundProperty, "InstallerWindowLightTextForeground");
 }
 private void DrawerAnimationTimer_Elapsed(object sender, ElapsedEventArgs e)
 {
     this.Dispatcher.Invoke((Delegate)(() =>
     {
         BlueStacksUIBinding.BindColor((DependencyObject)this.ParentWindow.mTopBar.mNotificationCaret, Shape.FillProperty, "ContextMenuItemBackgroundColor");
         BlueStacksUIBinding.BindColor((DependencyObject)this.ParentWindow.mTopBar.mNotificationCaret, Shape.StrokeProperty, "ContextMenuItemBackgroundColor");
         BlueStacksUIBinding.BindColor((DependencyObject)this.ParentWindow.mTopBar.mNotificationCentreDropDownBorder, Control.BorderBrushProperty, "PopupBorderBrush");
         this.ParentWindow.mTopBar.mNotificationDrawerControl.mAnimationRect.Visibility = Visibility.Collapsed;
         this.ParentWindow.mTopBar.mNotificationCentreButton.ImageName = "notification";
         this.ParentWindow.mTopBar.mNotificationCountBadge.Visibility = Visibility.Collapsed;
         if (!this.ParentWindow.IsActive)
         {
             return;
         }
         this.ParentWindow.mTopBar.mNotificationCentrePopup.IsOpen = true;
     }));
 }
 private void AddNotificationItem(GenericNotificationItem notifItem)
 {
     try
     {
         NotificationDrawerItem notificationDrawerItem = new NotificationDrawerItem();
         notificationDrawerItem.InitFromGenricNotificationItem(notifItem, this.ParentWindow);
         if (notifItem.Priority == NotificationPriority.Important)
         {
             StackPanel content   = this.mImportantNotificationScroll.Content as StackPanel;
             Separator  separator = new Separator();
             if (this.FindResource((object)ToolBar.SeparatorStyleKey) is Style resource)
             {
                 separator.Style = resource;
             }
             BlueStacksUIBinding.BindColor((DependencyObject)separator, Panel.BackgroundProperty, "HorizontalSeparator");
             separator.Margin = new Thickness(0.0);
             if (content.Children.OfType <NotificationDrawerItem>().Any <NotificationDrawerItem>())
             {
                 content.Children.Insert(0, (UIElement)separator);
             }
             content.Children.Insert(0, (UIElement)notificationDrawerItem);
             this.grdImportantUpdates.Visibility = Visibility.Visible;
         }
         else
         {
             StackPanel content   = this.mNotificationScroll.Content as StackPanel;
             Separator  separator = new Separator();
             if (this.FindResource((object)ToolBar.SeparatorStyleKey) is Style resource)
             {
                 separator.Style = resource;
             }
             BlueStacksUIBinding.BindColor((DependencyObject)separator, Panel.BackgroundProperty, "HorizontalSeparator");
             separator.Margin = new Thickness(0.0);
             if (content.Children.OfType <NotificationDrawerItem>().Any <NotificationDrawerItem>())
             {
                 content.Children.Insert(0, (UIElement)separator);
             }
             content.Children.Insert(0, (UIElement)notificationDrawerItem);
             this.grdNormalUpdates.Visibility = Visibility.Visible;
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Could not add notificationdraweritem. Id " + notifItem.Id + "Error:" + ex.ToString());
     }
 }
        internal void UpdateUi(MainWindow.UiStates val)
        {
            this.Dispatcher.Invoke((Delegate)(() =>
            {
                switch (val)
                {
                case MainWindow.UiStates.progress:
                    this.mProgressGrid.Visibility = Visibility.Visible;
                    this.mBodyText.Text = LocaleStrings.GetLocalizedString("STRING_PLEASE_DO_NOT_LAUNCH", "");
                    this.mTitle.Text = LocaleStrings.GetLocalizedString("STRING_DISK_CLEANUP_PROGRESS", "");
                    this.mButtonGrid.Visibility = Visibility.Collapsed;
                    this.mMinimizeButton.Visibility = Visibility.Visible;
                    BlueStacksUIBinding.BindColor((DependencyObject)this.mBodyText, TextBlock.ForegroundProperty, "PopupWindowWarningForegroundColor");
                    this.mCrossButton.IsEnabled = false;
                    this.mCrossButton.Opacity = 0.5;
                    break;

                case MainWindow.UiStates.error:
                    this.mProgressGrid.Visibility = Visibility.Collapsed;
                    this.mMinimizeButton.Visibility = Visibility.Collapsed;
                    this.mTitle.Text = LocaleStrings.GetLocalizedString("STRING_DISK_CLEANUP", "");
                    BlueStacksUIBinding.BindColor((DependencyObject)this.mBodyText, TextBlock.ForegroundProperty, "SettingsWindowTitleBarForeGround");
                    this.mBodyText.Text = string.Format("{0} {1}", (object)LocaleStrings.GetLocalizedString("STRING_DISK_CLEANUP_COULD_NOT_COMPLETE", ""), (object)LocaleStrings.GetLocalizedString("STRING_PLEASE_RESTART_PC_TRY_AGAIN", ""));
                    this.mButtonGrid.Visibility = Visibility.Visible;
                    this.mBtn.Visibility = Visibility.Collapsed;
                    this.mCancelBtn.Content = (object)LocaleStrings.GetLocalizedString("STRING_CLOSE", "");
                    this.mCancelBtn.ButtonColor = ButtonColors.Blue;
                    this.mCrossButton.IsEnabled = true;
                    this.mCrossButton.Opacity = 0.5;
                    break;

                case MainWindow.UiStates.success:
                    this.mProgressGrid.Visibility = Visibility.Collapsed;
                    this.mMinimizeButton.Visibility = Visibility.Collapsed;
                    this.mTitle.Text = LocaleStrings.GetLocalizedString("STRING_DISK_CLEANUP_SUCCESSFUL", "");
                    this.mBodyText.Text = string.Format("{0}\n{1}", (object)LocaleStrings.GetLocalizedString("STRING_DISK_SUCCESSFULLY_CLEANDED", ""), (object)LocaleStrings.GetLocalizedString("STRING_INSTANCE_LAUNCH_CONFIRMATION", ""));
                    BlueStacksUIBinding.BindColor((DependencyObject)this.mBodyText, TextBlock.ForegroundProperty, "SettingsWindowTitleBarForeGround");
                    this.mButtonGrid.Visibility = Visibility.Visible;
                    this.mBtn.Content = (object)LocaleStrings.GetLocalizedString("STRING_LAUNCH", "");
                    this.mCrossButton.IsEnabled = true;
                    this.mCrossButton.Opacity = 1.0;
                    break;
                }
            }));
        }
        private void SetMaskGrid()
        {
            this.mMaskBorder.SnapsToDevicePixels = true;
            this.mMaskBorder.SetValue(RenderOptions.EdgeModeProperty, (object)EdgeMode.Aliased);
            BlueStacksUIBinding.BindColor((DependencyObject)this.mMaskBorder, Control.BackgroundProperty, "ContextMenuItemBackgroundColor");
            if (this.IsCustomCornerRadius)
            {
                this.mMaskBorder.CornerRadius = this.CustomCornerRadius;
            }
            else
            {
                BlueStacksUIBinding.BindCornerRadius((DependencyObject)this.mMaskBorder, Border.CornerRadiusProperty, "SettingsWindowRadius");
            }
            VisualBrush visualBrush = new VisualBrush((Visual)this.mMaskBorder);

            visualBrush.Stretch        = Stretch.None;
            this.mMainGrid.OpacityMask = (Brush)visualBrush;
        }
 private void SetOuterBorder()
 {
     this.mOuterBorder.BorderThickness = new Thickness(1.0);
     BlueStacksUIBinding.BindColor((DependencyObject)this.mOuterBorder, Control.BackgroundProperty, "ContextMenuItemBackgroundColor");
     if (this.IsCustomBorderBrush)
     {
         this.mOuterBorder.BorderBrush = this.CustomBorderBrush;
     }
     else
     {
         BlueStacksUIBinding.BindColor((DependencyObject)this.mOuterBorder, Control.BorderBrushProperty, "PopupBorderBrush");
     }
     if (this.IsCustomCornerRadius)
     {
         this.mOuterBorder.CornerRadius = this.CustomCornerRadius;
     }
     else
     {
         BlueStacksUIBinding.BindCornerRadius((DependencyObject)this.mOuterBorder, Border.CornerRadiusProperty, "SettingsWindowRadius");
     }
 }
 private void SetColor(bool isPressed = false)
 {
     if (isPressed)
     {
         BlueStacksUIBinding.BindColor((DependencyObject)this.mBorder, Control.BorderBrushProperty, "SidebarElementClick");
         BlueStacksUIBinding.BindColor((DependencyObject)this.mBorder, Control.BackgroundProperty, "SidebarElementClick");
         BlueStacksUIBinding.BindColor((DependencyObject)this, Control.ForegroundProperty, "SidebarElementClick");
     }
     else if (this.IsMouseOver)
     {
         BlueStacksUIBinding.BindColor((DependencyObject)this.mBorder, Control.BorderBrushProperty, "SidebarElementHover");
         BlueStacksUIBinding.BindColor((DependencyObject)this.mBorder, Control.BackgroundProperty, "SidebarElementHover");
         BlueStacksUIBinding.BindColor((DependencyObject)this, Control.ForegroundProperty, "SidebarElementHover");
     }
     else
     {
         BlueStacksUIBinding.BindColor((DependencyObject)this.mBorder, Control.BorderBrushProperty, "SidebarElementNormal");
         BlueStacksUIBinding.BindColor((DependencyObject)this.mBorder, Control.BackgroundProperty, "SidebarElementNormal");
         BlueStacksUIBinding.BindColor((DependencyObject)this, Control.ForegroundProperty, "SidebarElementNormal");
     }
 }
        private void Button_MouseEnter(object sender, MouseEventArgs e)
        {
            if (this.mAppIconModel.IsDownloading)
            {
                this.ShowAppUninstallButton(true);
            }
            if (this.mAppIconModel.IsDownLoadingFailed || this.mAppIconModel.IsInstallingFailed)
            {
                this.mRetryGrid.Visibility = Visibility.Visible;
            }
            if (this.mBusyGrid.Visibility == Visibility.Visible)
            {
                return;
            }
            DropShadowEffect dropShadowEffect = new DropShadowEffect();

            BlueStacksUIBinding.BindColor((DependencyObject)dropShadowEffect, DropShadowEffect.ColorProperty, "AppIconDropShadowBrush");
            dropShadowEffect.Direction   = 270.0;
            dropShadowEffect.ShadowDepth = 1.0;
            dropShadowEffect.BlurRadius  = 20.0;
            dropShadowEffect.Opacity     = 1.0;
            this.mAppImageBorder.Effect  = (Effect)dropShadowEffect;
            ScaleTransform scaleTransform = new ScaleTransform(1.02, 1.02);

            this.mAppImage.RenderTransformOrigin      = new Point(0.5, 0.5);
            this.mAppImage.RenderTransform            = (Transform)scaleTransform;
            this.AppNameTextBox.RenderTransformOrigin = new Point(0.5, 0.5);
            this.AppNameTextBox.RenderTransform       = (Transform)scaleTransform;
            if (this.mAppIconModel.IconLocation == AppIconLocation.Dock || this.mAppIconModel.IconLocation == AppIconLocation.Moreapps)
            {
                this.ParentWindow.mWelcomeTab.mHomeAppManager.ShowDockIconTooltip(this, true);
                dropShadowEffect.BlurRadius = 12.0;
                this.mAppImageBorder.Effect = (Effect)dropShadowEffect;
            }
            if (!this.mAppIconModel.IsAppSuggestionActive)
            {
                return;
            }
            this.ParentWindow.mWelcomeTab.mHomeAppManager.OpenAppSuggestionPopup(this.mAppIconModel.AppSuggestionInfo, (UIElement)this.AppNameTextBox, true);
        }
Example #30
0
 private void mChangeWallpaperGrid_MouseEnter(object sender, MouseEventArgs e)
 {
     if (File.Exists(HomeAppManager.BackgroundImagePath))
     {
         this.mChangeWallpaperGrid.MouseLeftButtonUp -= new MouseButtonEventHandler(this.ChooseNewGrid_MouseLeftButtonUp);
         this.mWallpaperPopup.PlacementTarget         = (UIElement)this.mChooseNewGrid;
         this.mChooseWallpaperPopup.IsOpen            = false;
         this.mChooseWallpaperPopup.IsOpen            = true;
     }
     else
     {
         if (!RegistryManager.Instance.IsPremium)
         {
             this.mWallpaperPopup.PlacementTarget = (UIElement)this.mChangeWallpaperGrid;
             this.mWallpaperPopup.IsOpen          = false;
             this.mWallpaperPopup.IsOpen          = true;
         }
         this.mChangeWallpaperGrid.MouseLeftButtonUp -= new MouseButtonEventHandler(this.ChooseNewGrid_MouseLeftButtonUp);
         this.mChangeWallpaperGrid.MouseLeftButtonUp += new MouseButtonEventHandler(this.ChooseNewGrid_MouseLeftButtonUp);
     }
     BlueStacksUIBinding.BindColor((DependencyObject)(sender as Grid), Panel.BackgroundProperty, "ContextMenuItemBackgroundHoverColor");
 }