Exemplo n.º 1
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            var grids = layout.Grids.ToList();
            _grid1 = grids[0];
            _grid2 = grids[1];
            _grid3 = grids[2];
            _grid4 = grids[3];

            _grid1.OnlyAllowSingleSelection = true;
            grids.ForEach(g => g.ClearButtons());
            grids.ForEach(g => g.AutoUnselectOnTouch = true);
            grids.ForEach(g => g.EnablePaging = true);
            grids.ForEach(g => g.PlaceholderCount = 100);

            _grid1.Title = "Fixtures";
            for (int i = 1; i < 20; i++)
            {
                _grid1.AddButton("Fixture " + i.ToString());
            }

            _grid1.ButtonSelected += OnFixtureButtonSelected;
            _grid1.ButtonUnselected += OnFixtureButtonUnselected;

            foreach (var f in System.IO.Directory.GetFiles("C:\\SFX", "*.wav"))
            {
                var fInfo = new System.IO.FileInfo(f);
                var sfxBtn = _grid3.AddButton(fInfo.Name);
                sfxBtn.ActionInfo = fInfo;
                sfxBtn.ButtonSelected += OnSfxButtonSelected;
            }
        }
Exemplo n.º 2
0
        private void OnFixtureButtonSelected(MagicGridButton button, MagicGridControl parentGridControl)
        {
            //_grid1.Buttons.Where(b => b != button).ToList().ForEach(b => b.Unselect());
            _grid2.ClearButtons();
            //_grid3.ClearButtons();
            //_grid4.ClearButtons();

            _grid2.Title = "Intensity";

            for (int i = 0; i <= 100; i=i+10)
            {
                _grid2.AddButton(i.ToString() + "%");
            }
        }
Exemplo n.º 3
0
 private void OnFixtureButtonUnselected(MagicGridButton button, MagicGridControl parentGridControl)
 {
 }
Exemplo n.º 4
0
 private void OnSfxButtonSelected(MagicGridButton button, MagicGridControl parentGridControl)
 {
     System.IO.FileInfo fInfo = button.ActionInfo;
     System.Media.SoundPlayer sp = new System.Media.SoundPlayer(fInfo.FullName);
     sp.Play();
     System.Threading.ThreadPool.QueueUserWorkItem(o =>
     {
         System.Threading.Thread.Sleep(1000);
         this.Dispatcher.Invoke(new Action(() => { button.Unselect(); }));
     });
 }
Exemplo n.º 5
0
 private void OnChildButtonUnselected(MagicGridButton button, MagicGridControl parentGridControl)
 {
     if (ButtonUnselected != null) { ButtonUnselected(button, parentGridControl); }
 }
Exemplo n.º 6
0
        private void OnChildButtonSelected(MagicGridButton button, MagicGridControl parentGridControl)
        {
            if (ButtonSelected != null) { ButtonSelected(button, parentGridControl); }

            if (OnlyAllowSingleSelection)
            {
                foreach (var btn in Buttons)
                {
                    if (btn != button && btn.IsSelected) { btn.Unselect(true); }
                }
            }
        }