Beispiel #1
0
 private void showNewPalette(Palette palette = null)
 {
     palette                 = palette ?? new Palette();
     palWindow               = new PaletteWindow(this, palette);
     palWindow.Closing      += PalWindow_Closing;
     palWindow.ColorChanged += PalWindow_ColorChanged;
     palWindow.Show();
     butAddPalette.IsEnabled = true;
 }
Beispiel #2
0
    private void OnPaletteClick(object o, RoutedEventArgs e)
    {
        var palette = new PaletteWindow {
            Owner = this
        };

        if (palette.ShowDialog() == true)
        {
            (o as Button).Background = new SolidColorBrush(palette.SelectedColor);
        }
    }
    static void Init()
    {
        var savedData = SaveData.Load(Application.streamingAssetsPath + "\\" + "ColorPalette.uml");

        savedData.TryGetValue <List <Color> >("ColorPalette", out _colors);

        PaletteWindow window = (PaletteWindow)EditorWindow.GetWindow(typeof(PaletteWindow));

        window.minSize = new Vector2(320, 74);
        window.maxSize = new Vector2(320, 74);

        window.Show();
    }