Solved

IEnumerable

Posted on 2008-06-21
9
185 Views
Last Modified: 2013-11-12
How do you use the  IEnumerable in silverlight as the MSDN example is confusing.
0
Comment
Question by:jagguy
  • 8
9 Comments
 
LVL 1

Accepted Solution

by:
jacek_j1978 earned 500 total points
ID: 21837720
Hi,
I suppose that you think about this example:
http://msdn.microsoft.com/en-us/library/system.collections.ienumerable(VS.95).aspx
Could you clarify what is not clear for you?
0
 

Author Comment

by:jagguy
ID: 21839275
i am using hittest and it returns this data type which I dont know how to use it, is it like an array or collection?
0
 

Author Comment

by:jagguy
ID: 21839283
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
0
 

Author Comment

by:jagguy
ID: 21839366
In mouseup this didnt work but i didnt get an error

  Dim u = From element In lb.HitTest(e.GetPosition(Nothing)) _
        Where element Is txt1 Select element

        If u.Count() > 0 Then
            txt1.Text = "hit"
        Else
            txt1.Text = "miss"
        End If
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:jagguy
ID: 21840020
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(Nothing)) _
         Where element.GetValue(NameProperty).ToString = "txt1" _
        Or element.GetValue(NameProperty).ToString = "lb" Select element




        txt1.Text = u.Count
0
 

Author Comment

by:jagguy
ID: 21840027
this doesnt work either as i get 0 always

      Dim u = From element In Me.HitTest(e.GetPosition(Nothing)) _
         Where element.GetValue(NameProperty).ToString Is "txt1" _
        Or element.GetValue(NameProperty).ToString Is "lb" Select element




        txt1.Text = u.Count
0
 

Author Comment

by:jagguy
ID: 21840357
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(Nothing))

        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
0
 

Author Comment

by:jagguy
ID: 21840449
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(Nothing))

        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
0
 

Author Comment

by:jagguy
ID: 21842525
anyone?
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Custom auto number 6 51
windbg taking it's time 32 54
Convert string to date 3 40
Javascript Refresh Parent Page from Popup 3 27
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now