Hi there,
I am using following code in silverlight for " autocompletebox with highlighted text" . ref. from. [http://www.pitorque.de/MisterGoodcat/post/A-highlighting-AutoCompleteBox-in-Silverlight.aspx]
<
basicControls:AutoCompleteBox
x:Name
=
"quickSearch"
Style
=
"{StaticResource
SearchTextBoxStyle}"
FilterMode
=
"Contains"
SelectedItem
=
"{Binding
SelectedSearch, Mode=TwoWay}"
KeyUp
=
"quickSearchDiagrams_KeyUp"
SelectionChanged
=
"quickSearchDiagrams_SelectionChanged"
ValueMemberPath
=
"FacilityAddress.AddressLine1"
>
<
basicControls:AutoCompleteBox.ItemTemplate
>
<
DataTemplate
>
<
basicControls:HighlightingTextBlock
x:Name
=
"BCHighlightingTextBlock"
Text
=
"{Binding
FacilityAddress.AddressLine1}"
HighlightedText
=
"{Binding
Text, ElementName=quickSearch,UpdateSourceTrigger=PropertyChanged}"
FilterMode
=
"Contains"
ToolTipService.ToolTip
=
"{Binding
FacilityAddress.AddressLine1}"
/>
</
DataTemplate
>
</
basicControls:AutoCompleteBox.ItemTemplate
>
</
basicControls:AutoCompleteBox
>
The basicControls:HighlightingTextBlock is implementing the highlighting functionality. Here if you see the basicControls:HighlightingTextBlock control
is taking value of basicControls:AutoCompleteBox
control
as HighlightedText
=
"{Binding
Text, ElementName=quickSearch,UpdateSourceTrigger=PropertyChanged}".
But Issue is, HighlightedText able to get the value only on first search action of page load and lost on scroll. But when tried search again then everything is working fine.
Here the issue i found is "HighlightedText" this dependent property was not having value on first search click when the url firstly requested and xaps are downloaded first time.
Could any one please help me to fix this. I am unable to understand why on first time the value is null.