1 2 3 |
var brush = new ImageBrush(); brush.ImageSource = new BitmapImage(new Uri("Images/myImage.png", UriKind.Relative)); button1.Background = brush; |
1 2 3 |
var brush = new ImageBrush(); brush.ImageSource = new BitmapImage(new Uri("Images/myImage.png", UriKind.Relative)); button1.Background = brush; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#region motion sensor Thread.Sleep(30000); tone = new FEZ_Components.Piezo(FEZ_Pin.PWM.Di5); InterruptPort motion = new InterruptPort((Cpu.Pin)FEZ_Pin.Interrupt.Di1, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeHigh); motion.OnInterrupt += new NativeEventHandler(motion_OnInterrupt); Thread.Sleep(-1); #endregion static void motion_OnInterrupt(uint data1, uint data2, DateTime time) { tone.Play(400, 1000); } |