There is a standard for designating user interface controls in WPF. Something like Hungarian notation.
for instance
<TextBox Name=tbNameOfTextBox/>
<Image Name=imgOfMe/>
<RichTextBox Name="rtbDocument"/>
What notation do you use?
And my second question is about consistency, organizational properties in an element.
Here is an example:
<ListBox Name="friendsListBox"
ItemsSource="{Binding}"
SelectedItem="Key"
Style="{DynamicResource friendsListStyle}"
PreviewMouseRightButtonUp="ListBox_PreviewMouseRightButtonUp"
PreviewMouseRightButtonDown="ListBox_PreviewMouseRightButtonDown"
Grid.Row="2"
Margin="4,4,4,4"
MouseRightButtonDown="FriendsListBoxMouseRightButtonDown">
or
<TextBox Name="TbStatus"
Text="{Binding Path=Message, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource CurveTextBox}"
Grid.Column="1"
TextWrapping="Wrap"
Margin="3,3,3,3" LostFocus="TbStatus_LostFocus" />
In listbox, I have properties like Name, ItemSource, SelectedItem and som Events. What is suitable for their organization. Should the first be the name of the user interface control, then the events, and finally the style properties?
user481758
source
share