<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<StackPanel>
<TextBlock>接收人列表:</TextBlock>
<TextBox Name="txtTo">
<TextBox.InputScope>
<InputScope>
<InputScopeName NameValue="NameOrPhoneNumber"/>
</InputScope>
</TextBox.InputScope>
</TextBox>
<TextBlock Margin="0,15,0,0">内容:</TextBlock>
<TextBox Name="txtBody" Height="200"/>
<Button Content="发送短信" Click="OnSendClick"/>
</StackPanel>
</Grid>
</Grid>
private void OnSendClick(object sender, RoutedEventArgs e)
{
// 1、实例化组件
SmsComposeTask SMS = new SmsComposeTask();
// 2、设置相关属性
SMS.To = txtTo.Text;
SMS.Body = txtBody.Text;
// 3、显示UI界面
SMS.Show();
}