Exemple #1
0
        private void EnterAdjustConversionState()
        {
            this.adjustmentContainerGrid.Visibility = Visibility.Visible;
            this.questionTextBlock.Visibility       = Visibility.Visible;
            this.AdjustmentAnimation.Begin();
            // Subscribe to back button press event on parent
            PhoneApplicationPage page = this.GetPage(this);

            page.BackKeyPress += page_BackKeyPress;
            // Kick out any other buttons in the adjusting state
            if (ConversionResultsBtn.CurrentlyAdjusting != null)
            {
                ConversionResultsBtn.CurrentlyAdjusting.LeaveAdjustConversionState();
            }
            ConversionResultsBtn.CurrentlyAdjusting = this;
            // Give help if not done already
            if (App.Settings.GetValueOrDefault <bool>("ShowHelpAdjustment", true))
            {
                MessageBoxResult res = MessageBox.Show("Tap a brand name to adjust the sizes."
                                                       + Environment.NewLine
                                                       + Environment.NewLine
                                                       + "If you don't want to make an adjustment, tap the brand name again or hit the back button.",
                                                       "Making an adjustment", MessageBoxButton.OK);
                App.Settings.AddOrUpdateValue("ShowHelpAdjustment", false);
                App.Settings.Save();
            }
        }
Exemple #2
0
        private static void BtnShowBlacklistedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ConversionResultsBtn cBtn = (ConversionResultsBtn)d;
            bool val = (bool)e.NewValue;

            if (val)
            {
                cBtn.notBlacklistedCheckBox.Visibility = Visibility.Visible;
            }
            else
            {
                cBtn.notBlacklistedCheckBox.Visibility = Visibility.Collapsed;
            }
            cBtn.NotifyPropertyChanged("BtnVisibility");
        }
Exemple #3
0
        private void LeaveAdjustConversionState()
        {
            this.adjustmentContainerGrid.Visibility = Visibility.Collapsed;
            this.questionTextBlock.Visibility       = Visibility.Collapsed;
            this.AdjustmentAnimation.Stop();
            // Unsubscribe to back button press event on parent
            PhoneApplicationPage page = this.GetPage(this);

            page.BackKeyPress -= page_BackKeyPress;
            // Done adjusting
            if (ConversionResultsBtn.CurrentlyAdjusting == this)
            {
                ConversionResultsBtn.CurrentlyAdjusting = null;
            }
        }
Exemple #4
0
        private static void BtnIsBlacklistedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ConversionResultsBtn cBtn = (ConversionResultsBtn)d;
            bool val = (bool)e.NewValue;

            if (val == true)
            {
                cBtn.conversionResultContainerGrid.Opacity = 0.5;
            }
            else
            {
                cBtn.conversionResultContainerGrid.Opacity = 1.0;
            }
            cBtn.NotifyPropertyChanged("BtnIsBlacklisted");
            cBtn.NotifyPropertyChanged("BtnVisibility");
        }