Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

IEnumerable

Posted on 2008-06-21
9
Medium Priority
?
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
9 Comments
 
LVL 1

Accepted Solution

by:
jacek_j1978 earned 2000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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
 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

715 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