Click here to Skip to main content
15,886,362 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Render WPF Control to Image in Console App Pin
#realJSOP25-Jun-12 6:23
mve#realJSOP25-Jun-12 6:23 
GeneralRe: Render WPF Control to Image in Console App Pin
Pete O'Hanlon25-Jun-12 3:28
mvePete O'Hanlon25-Jun-12 3:28 
GeneralRe: Render WPF Control to Image in Console App Pin
#realJSOP25-Jun-12 6:23
mve#realJSOP25-Jun-12 6:23 
GeneralRe: Render WPF Control to Image in Console App Pin
#realJSOP25-Jun-12 3:49
mve#realJSOP25-Jun-12 3:49 
AnswerRe: Render WPF Control to Image in Console App Pin
JOAT-MON25-Jun-12 9:17
JOAT-MON25-Jun-12 9:17 
GeneralRe: Render WPF Control to Image in Console App Pin
#realJSOP26-Jun-12 4:04
mve#realJSOP26-Jun-12 4:04 
GeneralRe: Render WPF Control to Image in Console App Pin
JOAT-MON26-Jun-12 9:16
JOAT-MON26-Jun-12 9:16 
QuestionVirtualizationMode="Recycling" Issue And Hackish Fix?? Pin
FocusedWolf22-Jun-12 18:24
FocusedWolf22-Jun-12 18:24 
Source: http://www.fileplay.net/file/15671/highlightsearchedtextinlistview[^]

Hi,

Normally i'd try to strip code down to it's minimum and post it here, but this is one of those instances where the bare minimum = 6 files so please pardon the need to download Poke tongue | ;-P

The Setup: Their's a listview with 3000 items with virtualization enabled in recycling mode. The ItemsSource property is bound to a collection of elements of type "Person". In the MainWindow i setup DataTemplates so the "Person" instances are represented by a custom control called "HighlightTextBlock" [it highlights portions of its text with a colored background if it matches its "HighlightPhrase" dependency property]. In MainWindow.xaml.cs the "FilterItems(...)" function uses a CollectionView to filter items so only ones with highlighted text are shown in the list.

The Issue: If you type some letters into the search box and then scroll down then you will see lots of items where the highlighting doesn't occur. Interestingly the problem doesn't occur if you enlarge the window to show more items.

The Hackish Fix: In HighlightTextBlock.cs, in the OnHighlightPhraseChanged(...) function [which fires when its associated dependency property "HighlightPhrase" changes], i found that the presence of this code "fixes" the problem:

C#
tb.Text = tb.Text;


Btw trying things like
C#
tb.InvalidateVisual();
had no effect here, and the HighlightPhraseProperty is using
C#
FrameworkPropertyMetadataOptions.AffectsRender


The Crappy Fix: If VirtualizingStackPanel.VirtualizationMode="Standard" is used then the problem goes away (without using the Hackish Fix).

Interestingly this guy had issues while scrolling with recycling-virtualization mode that didn't manifest when recycling-standard mode was used:

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a4792b31-0a0d-49e1-bcf1-62bb8e4e5326/[^]

Not Filtering With Collection Fix: The problem goes away if the contents of the "FilterItems(...)" function, in MainWindow.xaml.cs, is commented out so no CollectionView filtering is performed (without using the Hackish Fix).

So what i'm looking for is, maybe someone can explain why this behavior is occurring. Perhaps i'm doing something wrong etc.
AnswerRe: VirtualizationMode="Recycling" Issue And Hackish Fix?? Pin
FocusedWolf23-Jun-12 8:43
FocusedWolf23-Jun-12 8:43 
Questiondefault content for custom control Pin
Silent Winter20-Jun-12 1:58
Silent Winter20-Jun-12 1:58 
AnswerRe: default content for custom control Pin
Wayne Gaylard20-Jun-12 2:28
professionalWayne Gaylard20-Jun-12 2:28 
GeneralRe: default content for custom control Pin
Silent Winter20-Jun-12 3:40
Silent Winter20-Jun-12 3:40 
GeneralRe: default content for custom control Pin
Wayne Gaylard20-Jun-12 4:14
professionalWayne Gaylard20-Jun-12 4:14 
Questionclient side serial communication Pin
javadadabi16-Jun-12 22:31
javadadabi16-Jun-12 22:31 
AnswerRe: client side serial communication Pin
Abhinav S17-Jun-12 20:21
Abhinav S17-Jun-12 20:21 
GeneralRe: client side serial communication Pin
javadadabi18-Jun-12 0:51
javadadabi18-Jun-12 0:51 
AnswerRe: client side serial communication Pin
Abhinav S18-Jun-12 17:29
Abhinav S18-Jun-12 17:29 
GeneralRe: client side serial communication Pin
javadadabi18-Jun-12 19:35
javadadabi18-Jun-12 19:35 
AnswerRe: client side serial communication Pin
Gerry Schmitz19-Jun-12 0:27
mveGerry Schmitz19-Jun-12 0:27 
GeneralRe: client side serial communication Pin
javadadabi19-Jun-12 1:22
javadadabi19-Jun-12 1:22 
GeneralRe: client side serial communication Pin
Gerry Schmitz19-Jun-12 7:45
mveGerry Schmitz19-Jun-12 7:45 
GeneralRe: client side serial communication Pin
javadadabi20-Jun-12 8:29
javadadabi20-Jun-12 8:29 
GeneralRe: client side serial communication Pin
Pete O'Hanlon20-Jun-12 8:45
mvePete O'Hanlon20-Jun-12 8:45 
GeneralRe: client side serial communication Pin
Gerry Schmitz20-Jun-12 9:34
mveGerry Schmitz20-Jun-12 9:34 
GeneralRe: client side serial communication Pin
javadadabi20-Jun-12 17:21
javadadabi20-Jun-12 17:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.