夜灯项目:从界面设计到代码实现与部署
1. 用户界面设计
用户界面设计得非常简单,仅由几个标签和两个滑块组成。滑块用于控制光敏电阻(LDR)灵敏度范围的最小值和最大值,其中一个标签会显示从 LDR 读取的值,可利用该值来调整淡入淡出效果。
1.1 界面代码实现
以下是用户界面的 XAML 代码:
<Page
x:Class="NightLight.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:NightLight"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel Width="400" Height="400">
<TextBlock x:Name="title" Height="60" TextWrapping="NoWrap"
Text="Night Light Experiment" Font
超级会员免费看
订阅专栏 解锁全文
1343

被折叠的 条评论
为什么被折叠?



