Click here to Skip to main content
15,895,256 members
Home / Discussions / WPF
   

WPF

 
QuestionHow to acheive the given layout in Silverlight? Pin
New Coder1239-May-13 22:55
New Coder1239-May-13 22:55 
AnswerRe: How to acheive the given layout in Silverlight? Pin
Abhinav S12-May-13 7:47
Abhinav S12-May-13 7:47 
QuestionSL application does not works-nothing change Pin
picasso28-May-13 18:48
picasso28-May-13 18:48 
AnswerRe: SL application does not works-nothing change Pin
Abhinav S12-May-13 7:45
Abhinav S12-May-13 7:45 
QuestionBinding issues with Treeview C# WPF Pin
bartbartb2-May-13 11:41
bartbartb2-May-13 11:41 
AnswerRe: Binding issues with Treeview C# WPF Pin
Kenneth Haugland3-May-13 2:22
mvaKenneth Haugland3-May-13 2:22 
AnswerRe: Binding issues with Treeview C# WPF Pin
Mycroft Holmes9-May-13 12:23
professionalMycroft Holmes9-May-13 12:23 
QuestionVisualTreeHelper.HitTest / RectangleGeometry not working... Pin
SledgeHammer012-May-13 7:26
SledgeHammer012-May-13 7:26 
Trying to use VisualTreeHelper.HitTest on a TreeView. I have two arbitrary items. TreeViewItem1 and TreeViewItem2. These items may appear anywhere on the tree and have any sort of relationship (different parents, etc.). I've gotten the top left point of the two items. pt1 and pt2. I want to find the visible TreeViewItems in between. So I did:

VisualTreeHelper.HitTest(ParentTreeView, new HitTestFilterCallback(A), new HitTestResultCallback(B), new GeometryHitTestParameters(new RectangleGeometry(new Rect(0, pt1.Y, ParentTreeView.ActualWidth, (pt2.Y + 1) - pt1.Y))));

HitTestFilterBehavior A(DependencyObject potentialHitTestTarget)
{
if (potentialHitTestTarget is TreeViewItemEx)
{
if (((UIElement)potentialHitTestTarget).IsVisible)
System.Diagnostics.Debug.WriteLine(potentialHitTestTarget);
}

return HitTestFilterBehavior.Continue;
}

HitTestResultBehavior B(HitTestResult result)
{
return HitTestResultBehavior.Continue;
}

This code is working for the most part, except it's also returning parent items that it shouldn't. If my tree looks like:

1
_2
__3

and the two items in question are 2 & 3, the hit-test also returns 1.

A more ugly example is:

Root
_NodeWithChildren1
_NodeWithChildren2
_NodeWithChildren3
__1
__2
__3

the tree looks exactly like that on the screen. The items in question are _NodeWithChildren3 and __1. The hit-test returns Root and _NodeWithChildren1 and _NodeWithChildren2 as well.

Any ideas? I have confirmed that I am getting the correct item1 & item2 that I think I am getting and I have confirmed that the points I am getting are correct as well.
AnswerRe: VisualTreeHelper.HitTest / RectangleGeometry not working... Pin
Kenneth Haugland2-May-13 7:38
mvaKenneth Haugland2-May-13 7:38 
QuestionTab Closing Problem Pin
Kevin Marois1-May-13 20:14
professionalKevin Marois1-May-13 20:14 
AnswerRe: Tab Closing Problem Pin
AlphaDeltaTheta3-May-13 4:49
AlphaDeltaTheta3-May-13 4:49 
QuestionAsynchronous Call Using MVVM Pin
jonkjon29-Apr-13 10:21
jonkjon29-Apr-13 10:21 
AnswerRe: Asynchronous Call Using MVVM Pin
SledgeHammer0129-Apr-13 10:32
SledgeHammer0129-Apr-13 10:32 
GeneralRe: Asynchronous Call Using MVVM Pin
jonkjon29-Apr-13 10:48
jonkjon29-Apr-13 10:48 
Questionwin32 window as c# wpf control Pin
mkusnjer29-Apr-13 8:58
mkusnjer29-Apr-13 8:58 
AnswerRe: win32 window as c# wpf control Pin
SledgeHammer0129-Apr-13 9:28
SledgeHammer0129-Apr-13 9:28 
GeneralRe: win32 window as c# wpf control Pin
mkusnjer30-Apr-13 5:19
mkusnjer30-Apr-13 5:19 
GeneralRe: win32 window as c# wpf control Pin
SledgeHammer0130-Apr-13 10:58
SledgeHammer0130-Apr-13 10:58 
GeneralRe: win32 window as c# wpf control Pin
mkusnjer1-May-13 8:31
mkusnjer1-May-13 8:31 
GeneralRe: win32 window as c# wpf control Pin
SledgeHammer011-May-13 10:46
SledgeHammer011-May-13 10:46 
GeneralRe: win32 window as c# wpf control Pin
mkusnjer1-May-13 12:11
mkusnjer1-May-13 12:11 
GeneralRe: win32 window as c# wpf control Pin
SledgeHammer011-May-13 12:20
SledgeHammer011-May-13 12:20 
GeneralRe: win32 window as c# wpf control Pin
mkusnjer1-May-13 12:39
mkusnjer1-May-13 12:39 
GeneralRe: win32 window as c# wpf control Pin
SledgeHammer011-May-13 13:00
SledgeHammer011-May-13 13:00 
GeneralRe: win32 window as c# wpf control Pin
mkusnjer1-May-13 13:24
mkusnjer1-May-13 13:24 

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.