Solved

IEnumerable

Posted on 2008-06-21
9
186 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
.net VBA word safemode 1 35
How to open a link from vb.net app 3 21
Help with deleting records by comparing two files using VB.NET 8 55
More on Time zones in vb 2010 12 37
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

948 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

19 Experts available now in Live!

Get 1:1 Help Now