作为快速指南,您可以从以下课程开始:
public class AlarmDay : INotifyPropertyChanged
{
public AlarmDay( string dayOfWeek )
{
DayOfWeek = dayOfWeek;
}
public DayOfWeek { get; }
private bool _isEnabled = false;
public bool IsEnabled
{
get => _isEnabled;
set
{
_isEnabled = value;
NotifyPropertyChanged();
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
然后可以使用水平列表控件,将
ItemsSource
7个适当的实例
AlarmDay
班这个
DataTemplate
然后可以包含自定义控件,该控件将包含
Label
和a
Frame
具有圆角半径轮廓。然后实施
Tap
手势并更新
IsEnabled
数据绑定的属性
警报日
实例(在
BindingContext
)以及
框架
BackgroundColor
.