Esempio n. 1
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            double x = SystemParameters.WorkArea.Width;  //得到屏幕工作区域宽度
            double y = SystemParameters.WorkArea.Height; //得到屏幕工作区域高度

            vbMain.Width  = x / 2;
            vbMain.Height = vbMain.Width / 1338 * 860;

            if (isFirst)
            {
                launchpadPro      = new LaunchpadPro();
                launchpadPro.Size = 500;
                launchpadPro.SetLaunchpadBackground(new SolidColorBrush(Colors.Transparent));
                launchpadPro.SetButtonBackground(new SolidColorBrush(Color.FromRgb(19, 40, 61)));
                launchpadPro.SetButtonBorderBackground(new SolidColorBrush(Color.FromRgb(73, 191, 231)));
                launchpadPro.SetButtonClickEvent(OnLaunchpadClick);
                spTop.Children.Insert(0, launchpadPro);

                InitKeyboard();
                LoadKeyboards();

                SelectPosition(11);

                isFirst = false;
            }
        }
 /// <summary>
 /// 设置Launchpad样式
 /// </summary>
 /// <param name="mLaunchpad"></param>
 /// <param name="deviceModel"></param>
 public static void SetLaunchpadStyle(LaunchpadPro mLaunchpad,DeviceModel deviceModel) {
     mLaunchpad.SetLaunchpadBackground(deviceModel.DeviceBackGround);
     mLaunchpad.Size = deviceModel.DeviceSize;
     if (deviceModel.IsMembrane)
     {
         mLaunchpad.AddMembrane();
     }
 }
Esempio n. 3
0
        private void Animation_Completed(object sender, EventArgs e)
        {
            double d = wpMain.ActualWidth / pavedColumns;
            Dictionary <int, List <Light> > dil = Business.LightBusiness.GetParagraphLightLightList(mLightList);

            Count = dil.Count;
            int max = mw.pavedConfigModel.Max;

            if (dil.Count > max)
            {
                for (int i = dil.Count - 1; i >= max; i--)
                {
                    dil.Remove(dil.Last().Key);
                }
            }
            foreach (var item in dil)
            {
                LaunchpadPro pro = new LaunchpadPro();
                pro.SetLaunchpadBackground(new SolidColorBrush(Color.FromArgb(255, 83, 83, 83)));
                pro.SetData(item.Value);
                pro.Size = d;
                wpMain.Children.Add(pro);
            }
        }
Esempio n. 4
0
        public ShapeColorOperationChild(ShapeColorOperationModel shapeColorOperationModel, ScriptUserControl suc) : base(suc)
        {
            this.shapeColorOperationModel = shapeColorOperationModel;

            ComboBox cb = GetComboBox(new List <string>()
            {
                "Square", "Vertical", "Horizontal"
            }, null);

            cb.IsEnabled = false;
            AddTitleAndControl("TypeColon", cb);

            mLaunchpad.SetLaunchpadBackground(new SolidColorBrush(Color.FromRgb(43, 43, 43)));
            mLaunchpad.Size = 300;

            textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[0] + ""));
            textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[1] + ""));
            textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[2] + ""));
            textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[3] + ""));
            textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[4] + ""));

            if (shapeColorOperationModel.MyShapeType == ShapeColorOperationModel.ShapeType.SQUARE)
            {
                cb.SelectedIndex = 0;
            }
            else if (shapeColorOperationModel.MyShapeType == ShapeColorOperationModel.ShapeType.RADIALVERTICAL)
            {
                cb.SelectedIndex = 1;

                textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[5] + ""));
                textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[6] + ""));
                textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[7] + ""));
                textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[8] + ""));
                textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[9] + ""));
            }
            else if (shapeColorOperationModel.MyShapeType == ShapeColorOperationModel.ShapeType.RADIALVERTICAL)
            {
                cb.SelectedIndex = 2;

                textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[5] + ""));
                textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[6] + ""));
                textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[7] + ""));
                textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[8] + ""));
                textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[9] + ""));
            }
            GetTexeBlock(shapeColorOperationModel.TopString);

            List <FrameworkElement> frameworkElements = new List <FrameworkElement>();

            frameworkElements.Add(GetTexeBlock(shapeColorOperationModel.TopString));
            frameworkElements.AddRange(textBoxs.ToArray());
            frameworkElements.Add(GetTexeBlock(shapeColorOperationModel.BottomString));

            AddUIElement(GetDockPanel(mLaunchpad, GetVerticalStackPanel(frameworkElements))).
            AddUIElement(GetHorizontalStackPanel(new List <FrameworkElement>()
            {
                ViewBusiness.GetButton("Preview", Preview), ViewBusiness.GetButton("PasteValue", PasteRangeListContent)
            }));
            GetButton("Save", ToSave, out Button btn);
            AddUIElement(btn);

            CreateDialog();
        }