FlatColorPicker事件
本文描述了用于Blazor的Telerik FlatColorPicker的可用事件。
OnChange
的OnChange
事件触发时,用户提交他们的选择:
- 应用或取消按钮单击
- 输入键盘按键
注意OnChange
事件也可能在实际选择的颜色没有改变时触发。
事件类型为EventCallback <对象>
.的OnChange
对象的双向绑定价值
属性。
@*处理FlatColorPickerOnChange事件*@ @ eventlog
@code {string颜色{get;设置;} string EventLog {get;设置;} async任务FlatColorPickerOnChange(对象newColor) {EventLog =字符串。Format("The selected color is: {0}", (string)newColor);}}
ValueChanged
的ValueChanged
事件在用户选择新颜色且组件值发生变化时触发。
事件类型为EventCallback <字符串>
.使用ValueChanged
类型的单向绑定价值
在事件处理程序中更新属性和手动值。
@*处理FlatColorPickerValueChanged事件*@ @code {string颜色{get;设置;} async任务FlatColorPickerValueChanged(string newColor) {Color = newColor;}}
ViewChanged
的ViewChanged
事件在用户在组件视图之间切换时触发。
事件类型为EventCallback < ColorPickerView >
.使用ViewChanged
类型的单向绑定视图
在事件处理程序中更新属性和手动值。
@*处理FlatColorPickerViewChanged事件*@ @code {string Color {get;设置;} ColorPickerView查看{获取;设置;} async任务FlatColorPickerViewChanged(ColorPickerView newView){视图= newView;}}