private void OK_Click(object sender, RoutedEventArgs e)
        {
            FieldBlockViewer fbv = new FieldBlockViewer();

            fbv.field     = fld;
            fbv.BlockSize = (int)BlockSize.Value;
            fbv.Show();
            Close();
        }
예제 #2
0
        private void SelectColorButton(object sender, RoutedEventArgs e)
        {
            Filter       f = (sender as Button).DataContext as Filter;
            ColorControl c = new ColorControl();

            c.Show_Only_Color = true;
            if (f is BackgroundColorFilter)
            {
                BackgroundColorFilter b = f as BackgroundColorFilter;
                c.ColorPicker.SelectedColor = FieldPlanDocument.SDtoSM(b.color);
                if (c.ShowDialog() == true)
                {
                    b.color = FieldBlockViewer.SMtoSD(c.ColorPicker.SelectedColor);
                }
            }
            if (f is ReplaceFilter)
            {
                ReplaceFilter b = f as ReplaceFilter;
                if ((sender as Button).ToolTip.ToString() == "First Color")
                {
                    c.ColorPicker.SelectedColor = FieldPlanDocument.SDtoSM(b.source);
                    if (c.ShowDialog() == true)
                    {
                        b.source = FieldBlockViewer.SMtoSD(c.ColorPicker.SelectedColor);
                    }
                }
                else
                {
                    c.ColorPicker.SelectedColor = FieldPlanDocument.SDtoSM(b.target);
                    if (c.ShowDialog() == true)
                    {
                        b.target = FieldBlockViewer.SMtoSD(c.ColorPicker.SelectedColor);
                    }
                }
            }
            if (f is TintFilter)
            {
                TintFilter b = f as TintFilter;
                c.ColorPicker.SelectedColor = FieldPlanDocument.SDtoSM(b.color);
                if (c.ShowDialog() == true)
                {
                    b.color = FieldBlockViewer.SMtoSD(c.ColorPicker.SelectedColor);
                }
            }
            if (f is VignetteFilter)
            {
                VignetteFilter b = f as VignetteFilter;
                c.ColorPicker.SelectedColor = FieldPlanDocument.SDtoSM(b.color);
                if (c.ShowDialog() == true)
                {
                    b.color = FieldBlockViewer.SMtoSD(c.ColorPicker.SelectedColor);
                }
            }
            Redraw();
            OnPropertyChanged(null);
        }