Next we switch over to the Design time view of our mobile control. We will need to add a few simple controls to our form. <body
Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm">
<mobile:Form id="MainForm"
runat="server" title="X10 Home Automation">
<mobile:Label id="Label1"
runat="server">House Code:</mobile:Label>
<mobile:SelectionList id="HouseSelectionList"
runat="server">
<Item Value="A"
Text="A"></Item>
<Item Value="B"
Text="B"></Item>
<Item Value="C"
Text="C"></Item>
<Item Value="D"
Text="D"></Item>
</mobile:SelectionList>
<mobile:Label id="Label3"
runat="server">Device:</mobile:Label>
<mobile:SelectionList
id="DeviceSelectionList" runat="server">
<Item Value="1"
Text="1"></Item>
<Item Value="2"
Text="2"></Item>
<Item Value="3"
Text="3"></Item>
<Item Value="4"
Text="4"></Item>
<Item Value="5"
Text="5"></Item>
<Item Value="6"
Text="6"></Item>
<Item Value="7"
Text="7"></Item>
<Item Value="8"
Text="8"></Item>
<Item Value="9"
Text="9"></Item>
<Item Value="10"
Text="10"></Item>
</mobile:SelectionList>
<mobile:Label id="Label2"
runat="server">Action:</mobile:Label>
<mobile:SelectionList
id="ActionSelectionList" runat="server">
<Item Value="TurnOn"
Text="TurnOn" Selected="True"></Item>
<Item Value="TurnOff"
Text="TurnOff"></Item>
<Item Value="MakeBrighter"
Text="MakeBrighter"></Item>
<Item Value="MakeDimmer"
Text="MakeDimmer"></Item>
</mobile:SelectionList>
<mobile:Command
id="SendCommand" runat="server">Send
Command</mobile:Command>
</mobile:Form>
</body>
Notice that I used SelectionLists for all of the inputs. Since there is a very finite list of actions that the end user can take, this seemed the easiest approach. As an alternative one could argue that it would be better to have the house and device codes as input textboxes. This would allow the user to choose any house and device, not to mention it would shorten the amount of content that would need to be sent to the actual wireless device (something all of us need to think about). On the other hand, a finite list of items may be desirable in some instances. For example if one controls the coffee pot, you probably would not want that accessible via the wireless interface; it may prove hazardous to turn on the coffee pot while away from home.
You may also want to change the entire form layout to something more logical for you. For example, you have a set of predefined codes mapping to your actual home devices. You could easily have a single selection list (instead of the house and device code lists), that indicates which device you wanted to change, "desk lamp", "front Christmas lights", "front security camera", etc...