public static void SetUp(Image image)
 {
     if (lightSwitch == null)
     {
         lightSwitch = new LightSwitch(image);
     }
 }
Beispiel #2
0
 public PegImage(PropertyChangedEventHandler func)
 {
     _image = new Image();
     reset();
     lightSwitch = LightSwitch.getInstance();
     lightSwitch.PropertyChanged += new PropertyChangedEventHandler(func);
 }
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            LightSwitch.SetUp(LightSwitchImg);
            ColorButtonCollection buttonCollection = new ColorButtonCollection();

            ColorGrid.ItemsSource = buttonCollection.colorButtons;
            PegGrid.SetCanvas(PegCanvas);

            for (int i = 0; i < PegGrid.TOTAL_PEGS; i++)
            {
                PegItem peg = new PegItem();
                PegCanvas.Children.Add(peg.image);
            }
        }