Пример #1
0
        private void BtPickColor_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                tbControl = ((StackPanel)((FrameworkElement)sender).Parent).Children.OfType <TextBlock>().FirstOrDefault();
                lControl  = ((StackPanel)((FrameworkElement)sender).Parent).Children.OfType <Label>().FirstOrDefault();

                if (tbControl.Background is SolidColorBrush)
                {
                    //Color color = ((SolidColorBrush)tbControl.Background).Color;
                    //PART_SelectorColorPicker.SetColors(color);
                    PART_SelectorColorPicker.SetColors((SolidColorBrush)tbControl.Background);
                }
                if (tbControl.Background is LinearGradientBrush)
                {
                    LinearGradientBrush linearGradientBrush = (LinearGradientBrush)tbControl.Background;
                    PART_SelectorColorPicker.SetColors(linearGradientBrush);
                }

                PART_SelectorColor.Visibility = Visibility.Visible;
                PART_ThemeColor.Visibility    = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "ThemeModifier", "Error on BtPickColor_Click()");
            }
        }
        private void BtPickColor_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                tbControl = ((StackPanel)((FrameworkElement)sender).Parent).Children.OfType <TextBlock>().FirstOrDefault();

                if (tbControl.Background is SolidColorBrush)
                {
                    Color color = ((SolidColorBrush)tbControl.Background).Color;
                    PART_SelectorColorPicker.SetColors(color);
                }

                PART_SelectorColor.Visibility = Visibility.Visible;
                spSettings.Visibility         = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "HowLongToBeat");
            }
        }