Пример #1
0
        /// <summary>
        /// Called when [color property changed].
        /// </summary>
        /// <param name="d">The d.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void OnColorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Bubble b = d as Bubble;

            if (b == null)
            {
                return;
            }

            var color = (BubbleColor)e.NewValue;

            if (color != BubbleColor.Empty)
            {
                b.elBack.Fill = availableColors[color];
            }
        }
Пример #2
0
        private void MakeSelection(Bubble b)
        {
            if (b.Status != BubbleStatus.Normal)
            {
                return;
            }

            var column = GetColumn(b);
            var row    = GetRow(b);
            var color  = b.Color;


            if (!bubbles.CanSelect(row, column))
            {
                return;
            }

            bubbles.SelectBubble(row, column, color);

            SetSelectedScore(bubbles.SelectedScore);
        }