Click here to Skip to main content
15,891,744 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF ignores Storyboard.SpeedRatio or StoryBoard.SetSpeedRatio() Pin
ABitSmart25-May-09 17:13
ABitSmart25-May-09 17:13 
QuestionHow to implement TV tunner in WPF application Pin
Nekkantidivya25-May-09 4:31
Nekkantidivya25-May-09 4:31 
AnswerRe: How to implement TV tunner in WPF application Pin
Michael Sync23-Jul-09 20:40
Michael Sync23-Jul-09 20:40 
QuestionHow to get weather report in silver light page Pin
Nekkantidivya25-May-09 3:56
Nekkantidivya25-May-09 3:56 
QuestionRe: How to get weather report in silver light page Pin
Mark Salsbery25-May-09 7:57
Mark Salsbery25-May-09 7:57 
QuestionHow open a webpage in silver light as webbrowser control Pin
Nekkantidivya25-May-09 3:31
Nekkantidivya25-May-09 3:31 
AnswerRe: How open a webpage in silver light as webbrowser control Pin
Mark Salsbery25-May-09 7:35
Mark Salsbery25-May-09 7:35 
QuestionUsing LINQ on ObservableCollection<t></t> Pin
bluewavestrider25-May-09 1:26
bluewavestrider25-May-09 1:26 
Hello Guys, I thought I'll ask this question under the WPF forum since ObservableCollection is a WPF class.

I have a class Client of which I use to return a collection of clients from the database as an ObservableCollection:

ObservableCollection<Client> myClients = queries.GetClients();


where GetClients() is a method that returns a list of clients of type ObservableCollection<Client>

Now I use LINQ to run a search for clients as follows:


ObservableCollection<Client> filteredClients = null;
IEnumerable<Client> qry = from c in myClients
                          where c.Name.ToUpper().Contains(txtSearch.Text.ToUpper())
                          orderby c.Name
                          select c;

filteredClients = new ObservableCollection<Client>(qry);


Hence filteredClients is supposed to contain a subset of myClients of the same type ObservableCollection<Client>

My problem is that this works fine on my x64 vista/machine, but when I move it to my x86 vista/machine I get an error that:

Argument '1': cannot convert from 'System.Collections.Generic.IEnumerable<Client>' to 'System.Collections.Generic.List<Client>'


After poking around a bit, I discovered that in my Visual Studio (both machines run VS.NET 2008 on Framework 3.5) on the x64 machine,
the ObservableCollection<T> class has 3 overloads and one of them accepts an IEnumerable<T>, which is exactly what qry above is.

However, on my x86 as you can guess, there are only 2 constructors and IEnumerable<T> isn't one of the parameters. Just an empty overload and one that receives a List<T>

So then my question is why is there this disparity in the number of overloads on vista x64 platform and vista x86?
Does this mean that I would have to design an auxiliary class that'll return a List<T> from my backend rather than an ObservableCollection<T> for x86 platforms?

P.S:
That is just one of the compatibility problems I believe those of us building applications with WPF are facing. Another one I hit is that if I have a ListBox with a DataTemplate and I set its SelectedValuePath, it works fine on my x64 machine but appears null on my x86 machine.

My 2 pennies for other developers out there is that if you are building on x64 and it works great and looks good, please make sure you test on an x86 machine before hitting your customers

Thanks.

Live in fragments no longer. Only connect.

AnswerRe: Using LINQ on ObservableCollection Pin
ABitSmart25-May-09 3:33
ABitSmart25-May-09 3:33 
GeneralRe: Using LINQ on ObservableCollection Pin
bluewavestrider25-May-09 10:17
bluewavestrider25-May-09 10:17 
Questionsilverlight Pin
rajesh55525-May-09 0:38
rajesh55525-May-09 0:38 
QuestionHow to: Select multiple elements inside a panel? Pin
Kunal Chowdhury «IN»24-May-09 22:48
professionalKunal Chowdhury «IN»24-May-09 22:48 
AnswerRe: How to: Select multiple elements inside a panel? Pin
bluewavestrider25-May-09 2:12
bluewavestrider25-May-09 2:12 
GeneralRe: How to: Select multiple elements inside a panel? Pin
Kunal Chowdhury «IN»25-May-09 2:14
professionalKunal Chowdhury «IN»25-May-09 2:14 
QuestionIsolated Storage Pin
Noam Maoz24-May-09 3:43
Noam Maoz24-May-09 3:43 
AnswerRe: Isolated Storage Pin
Mark Salsbery24-May-09 8:34
Mark Salsbery24-May-09 8:34 
QuestionNeed some help to develop tetris game in asp.net as a web service using silverlight Pin
mirza asim24-May-09 2:00
mirza asim24-May-09 2:00 
AnswerRe: Need some help to develop tetris game in asp.net as a web service using silverlight Pin
Ray Cassick24-May-09 4:57
Ray Cassick24-May-09 4:57 
GeneralRe: Need some help to develop tetris game in asp.net as a web service using silverlight Pin
mirza asim24-May-09 20:54
mirza asim24-May-09 20:54 
QuestionDocking a treeview Pin
rehpot23-May-09 22:09
rehpot23-May-09 22:09 
AnswerRe: Docking a treeview Pin
ABitSmart24-May-09 21:37
ABitSmart24-May-09 21:37 
QuestionHow to develop Analog clock and Digital clock in WPF application Pin
Nekkantidivya23-May-09 1:50
Nekkantidivya23-May-09 1:50 
AnswerRe: How to develop Analog clock and Digital clock in WPF application Pin
ABitSmart23-May-09 4:14
ABitSmart23-May-09 4:14 
GeneralRe: How to develop Analog clock and Digital clock in WPF application Pin
Kevin McFarlane23-May-09 6:21
Kevin McFarlane23-May-09 6:21 
QuestionHow to get weather information into my WPF application Pin
Nekkantidivya22-May-09 21:36
Nekkantidivya22-May-09 21:36 

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.