Beispiel #1
0
        private void HandleToggleButtonUnChecked(object sender, RoutedEventArgs e)
        {
            //  ToggleButton toggle = sender as ToggleButton;
            MyToggle toggle = sender as MyToggle;

            toggle.state = 0;
            // toggle.Background = new SolidColorBrush(Windows.UI.Colors.Green);
            //throw new NotImplementedException();
            Debug.WriteLine("isChecked:" + toggle.IsChecked);
            Debug.WriteLine("State:" + toggle.state);
        }
Beispiel #2
0
        private void HandleToggleButtonChecked(object sender, RoutedEventArgs e)
        {
            // ToggleButton toggle = sender as ToggleButton;
            MyToggle toggle = sender as MyToggle;

            //  toggle.Background = new SolidColorBrush(Windows.UI.Colors.Yellow);
            //  throw new NotImplementedException();
            toggle.state = 1;
            Debug.WriteLine(toggle.Resources.Values);
            Debug.WriteLine("isChecked:" + toggle.IsChecked);
            Debug.WriteLine("State:" + toggle.state);

            var client = clientDict[sender as ToggleButton];

            Debug.WriteLine(client.Item1 + " " + client.Item2);
            //  throw new NotImplementedException();
        }
Beispiel #3
0
        //  List<int> vec_bs;

        public Room()
        {
            thepattern = new pattern();
            // thepattern.vec_bs = new List<int>(10000);
            // thepattern.vec_bs = new List<int>(5*16*10);
            thepattern.vec_bs  = new List <int>(5 * 16 * 10);
            thepattern.int_bnk = new List <int>(10);
            thepattern.int_prg = new List <int>(10);

            thepattern.int_vs  = new List <int>(10);
            thepattern.int_sl2 = new List <int>(10);


            for (int i = 0; i < 10; i++)
            {
                thepattern.int_vs.Add(0);
                thepattern.int_sl2.Add(0);
                thepattern.int_bnk.Add(0);
                thepattern.int_prg.Add(0);
            }

            for (int i = 0; i < (5 * 16 * 10); i++)
            {
                // Debug.WriteLine("LOOP" + i);
                thepattern.vec_bs.Add(0);
                //  thepattern.vec_bs.Add(0);
            }



            uniformGrid1.Columns       = 16;
            uniformGrid1.Rows          = 5;
            uniformGrid1.ColumnSpacing = 4;
            uniformGrid1.RowSpacing    = 4;
            uniformGrid1.Orientation   = Orientation.Horizontal;

            uniformGrid2.Columns = 3;
            uniformGrid2.Rows    = 1;

            uniformGrid2.ColumnSpacing = 4;
            uniformGrid2.RowSpacing    = 4;
            uniformGrid2.Orientation   = Orientation.Horizontal;

            uniformGrid1.Visibility = Visibility.Collapsed;
            uniformGrid2.Visibility = Visibility.Collapsed;


            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 16; j++)
                {
                    {
                        bu[i, j] = new MyToggle();
                        //bu[i, j].Background = new SolidColorBrush(Windows.UI.Colors.DarkBlue);
                        // bu[i, j].Content = "T";
                        //   bu[i, j].Click += HandleButtonClick;
                        bu[i, j].Checked   += HandleToggleButtonChecked;
                        bu[i, j].Unchecked += HandleToggleButtonUnChecked;
                        // bu[i, j].Tag = i;
                        //bool isOver = bu[i, j].IsPointerOver;

                        clientDict.Add(bu[i, j], new Tuple <int, int>(i, j));
                        bu[i, j].HorizontalAlignment = HorizontalAlignment.Stretch;
                        bu[i, j].VerticalAlignment   = VerticalAlignment.Stretch;
                        bu[i, j].IsThreeState        = false;
                        // b.IsThreeState = true;
                        uniformGrid1.Children.Add(bu[i, j]);
                    }
                }
            }
            bu[1, 1].state = 1;
            bu[1, 1].update();

            for (int i = 0; i < 3; i++)
            {
                slider[i]        = new Slider();
                slider[i].Header = "Volume";
                slider[i].Width  = 600;
                // slider[i].Height = 1000;
                sliderclientDict.Add(slider[i], i);
                slider[i].Orientation         = Orientation.Vertical;
                slider[i].HorizontalAlignment = HorizontalAlignment.Stretch;
                slider[i].VerticalAlignment   = VerticalAlignment.Stretch;

                slider[i].ValueChanged += Slider_ValueChanged;
                uniformGrid2.Children.Add(slider[i]);
            }
            //for (int i = 0; i < 2; i++) {
            //    prgButton[i] = new Button();
            //prgButton[i].HorizontalAlignment = HorizontalAlignment.Stretch;
            //prgButton[i].VerticalAlignment = VerticalAlignment.Stretch;
            //prgButton[i].Click += HandleprgButtonClicked;
            ////   saveSlot[i].Unchecked += HandleChannelSelUnChecked;
            //prgButton[i].Tag = i;
            //    //
            //    bnkButton[i] = new Button();
            //    bnkButton[i].HorizontalAlignment = HorizontalAlignment.Stretch;
            //    bnkButton[i].VerticalAlignment = VerticalAlignment.Stretch;
            //    bnkButton[i].Click += HandlebnkButtonClicked;
            //    //   saveSlot[i].Unchecked += HandleChannelSelUnChecked;
            //    bnkButton[i].Tag = i;

            //}
        }