-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f325938
commit 3424959
Showing
6 changed files
with
70 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<UserControl x:Class="Lamp.Simulator.RemoteControl" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:Lamp.Simulator" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" d:DesignWidth="300"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<Button Content="Red" x:Name="btnRed" Grid.Column="0" Grid.Row="1" Margin="5" /> | ||
<Button Content="Green" x:Name="btnGreen" Grid.Column="1" Grid.Row="1" Margin="5" /> | ||
<Button Content="Blue" x:Name="btnBlue" Grid.Column="2" Grid.Row="1" Margin="5" /> | ||
<Button Content="White" x:Name="btnWhite" Grid.Column="3" Grid.Row="1" Margin="5" /> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Windows.Controls; | ||
|
||
namespace Lamp.Simulator { | ||
|
||
public partial class RemoteControl : UserControl { | ||
|
||
public IrReceiver Ir { get; set; } | ||
|
||
public RemoteControl() { | ||
InitializeComponent(); | ||
btnRed.Click += (s, e) => { Send(0x0090); }; | ||
btnGreen.Click += (s, e) => { Send(0x0010); }; | ||
btnBlue.Click += (s, e) => { Send(0x0050); }; | ||
btnWhite.Click += (s, e) => { Send(0x00D0); }; | ||
} | ||
|
||
private void Send(short code) { | ||
if (Ir != null) { | ||
Ir.SendCode(code); | ||
} | ||
} | ||
|
||
} | ||
|
||
} |