jagguy
asked on
IEnumerable
How do you use the IEnumerable in silverlight as the MSDN example is confusing.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I cant understand properly as it is too big.
What do they mean by interface?
what is IEnumerator doing?
can i have a smaller example?
http://msdn.microsoft.com/en-us/library/system.collections.ienumerable(VS.95).aspx
What do they mean by interface?
what is IEnumerator doing?
can i have a smaller example?
http://msdn.microsoft.com/en-us/library/system.collections.ienumerable(VS.95).aspx
ASKER
In mouseup this didnt work but i didnt get an error
Dim u = From element In lb.HitTest(e.GetPosition(N othing)) _
Where element Is txt1 Select element
If u.Count() > 0 Then
txt1.Text = "hit"
Else
txt1.Text = "miss"
End If
Dim u = From element In lb.HitTest(e.GetPosition(N
Where element Is txt1 Select element
If u.Count() > 0 Then
txt1.Text = "hit"
Else
txt1.Text = "miss"
End If
ASKER
All I am doing is dragging a textbox and when i drag the textbox onto any part of the listbox then I want to get a hit message displayed.
Looking at other codes we are getting the position of 'nothing' from the canvas so I cant see how this makes sense. I translated c# into vb.net.
Dim u = From element In Me.HitTest(e.GetPosition(N othing)) _
Where element.GetValue(NamePrope rty).ToStr ing = "txt1" _
Or element.GetValue(NamePrope rty).ToStr ing = "lb" Select element
txt1.Text = u.Count
Looking at other codes we are getting the position of 'nothing' from the canvas so I cant see how this makes sense. I translated c# into vb.net.
Dim u = From element In Me.HitTest(e.GetPosition(N
Where element.GetValue(NamePrope
Or element.GetValue(NamePrope
txt1.Text = u.Count
ASKER
this doesnt work either as i get 0 always
Dim u = From element In Me.HitTest(e.GetPosition(N othing)) _
Where element.GetValue(NamePrope rty).ToStr ing Is "txt1" _
Or element.GetValue(NamePrope rty).ToStr ing Is "lb" Select element
txt1.Text = u.Count
Dim u = From element In Me.HitTest(e.GetPosition(N
Where element.GetValue(NamePrope
Or element.GetValue(NamePrope
txt1.Text = u.Count
ASKER
if i do this i will get a hit if i drag the textbox over the listbox BUT the textbox is not one of the items that appears in the result VAR from the for each.
let us forget about LINQ please for now.
Dim result = lb.HitTest(e.GetPosition(N othing))
Dim ui As UIElement
For Each ui In result
' If (ui Is txt1) Then
txt1.Text = txt1.Text & " " & ui.ToString 'textbox does not appear but the hitest will detect a hit with other UI objects
' End If
Next
let us forget about LINQ please for now.
Dim result = lb.HitTest(e.GetPosition(N
Dim ui As UIElement
For Each ui In result
' If (ui Is txt1) Then
txt1.Text = txt1.Text & " " & ui.ToString 'textbox does not appear but the hitest will detect a hit with other UI objects
' End If
Next
ASKER
this will only work if the mouse pointer in the textbox is also in the listbox so i need amore accurate way to get anypart over the listbox.
Dim result = lb.HitTest(e.GetPosition(N othing))
Dim ui As UIElement
For Each ui In result
' If (ui Is txt1) Then
txt1.Text = txt1.Text & " " & ui.ToString 'textbox does not appear but the hitest will detect a hit with other UI objects
' End If
Next
Dim result = lb.HitTest(e.GetPosition(N
Dim ui As UIElement
For Each ui In result
' If (ui Is txt1) Then
txt1.Text = txt1.Text & " " & ui.ToString 'textbox does not appear but the hitest will detect a hit with other UI objects
' End If
Next
ASKER
anyone?
ASKER