Hi there,
i am implementing a autocompletebox with Highlighted text. Following in XAML code,
i am implementing a autocompletebox with Highlighted text. Following in XAML code,
<
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.
HighlitedText is a property defined as following, inside a class
public bool IsHighlighted
{
get;
private set;
}
Any idea about this issue ?