【发布时间】:2013-12-05 15:07:53
【问题描述】:
我正在开发一个带有语音命令的系统,该系统适用于参数网格。 我想对正在编辑的元素应用一种样式,以便用户知道他在哪里...
MyView.xaml
<telerik:RadNumericUpDown Name={Binding Element[0].ID} Grid.Column="0" Name="Left" MinWidth="15" FontSize="11" Minimum="0" NumberDecimalDigits="0"
BorderThickness="0" Maximum="30"
IsInteger="True" ShowButtons="False" ShowTextBox="True"
HorizontalContentAlignment="Left" Value="{Binding Element[0].Input, Mode=TwoWay, ElementName=InputViewUserControl}" Background="Transparent" Foreground="#FF858585" />
<telerik:RadNumericUpDown Name={Binding Element[1].ID} Grid.Column="0" Name="Left" MinWidth="15" FontSize="11" Minimum="0" NumberDecimalDigits="0"
BorderThickness="0" Maximum="30"
IsInteger="True" ShowButtons="False" ShowTextBox="True"
HorizontalContentAlignment="Left" Value="{Binding Element[1].Input, Mode=TwoWay, ElementName=InputViewUserControl}" Background="Transparent" Foreground="#FF858585" />
<telerik:RadNumericUpDown Name={Binding Element[2].ID} Grid.Column="0" Name="Left" MinWidth="15" FontSize="11" Minimum="0" NumberDecimalDigits="0"
BorderThickness="0" Maximum="30"
IsInteger="True" ShowButtons="False" ShowTextBox="True"
HorizontalContentAlignment="Left" Value="{Binding Element[2].Input, Mode=TwoWay, ElementName=InputViewUserControl}" Background="Transparent" Foreground="#FF858585" />
.....我有 30 个元素所以...
如果用户说:元素一,我想将样式应用于元素[0]
如果你有什么想法,请告诉我谢谢:)
【问题讨论】:
-
考虑改变 LostFocus、GotFocus 的风格并根据您的语音处理功能设置焦点。
-
....i have 30 elements So...- 请立即删除所有可怕的重复并使用ItemsControl。 -
@Allel 问题是如何知道声音是什么,或者知道声音是什么之后,如何改变风格?
-
:) 这是我的问题的解决方案stackoverflow.com/questions/1356045/…