예제 #1
0
        private void btnColor_Click(object sender, RoutedEventArgs e)
        {
            Grid          main = App.WindowInstance.mainGrid;
            ColorPickerUC cp   = LogicalTreeHelper.FindLogicalNode(main, "colorPicker") as ColorPickerUC;

            if (cp == null)
            {
                App.Instance.AddMenu(new ColorPickerUC());
            }
        }
예제 #2
0
        private void ColorItem_MouseDown(object sender, MouseButtonEventArgs e)
        {
            ColorPickerUC cp = LogicalTreeHelper.FindLogicalNode(Application.Current.MainWindow, "colorPicker") as ColorPickerUC;

            if (cp != null)
            {
                cp.SelectedColor = color;
            }

#if DEBUG
            foreach (System.Reflection.PropertyInfo prop in typeof(Colors).GetProperties())
            {
                if (prop.PropertyType.FullName == "System.Windows.Media.Color")
                {
                    if ((Color)prop.GetGetMethod().Invoke(null, null) == color)
                    {
                        Logger.Debug(prop.Name + " " + color.ToString(Strings.Culture));
                        break;
                    }
                }
            }
#endif
        }