Click here to Skip to main content
15,914,447 members
Home / Discussions / WPF
   

WPF

 
QuestionWPF DataGrid with DataGridTemplateColumn and RadioButton Pin
ausadmin21-Oct-09 20:51
ausadmin21-Oct-09 20:51 
AnswerRe: WPF DataGrid with DataGridTemplateColumn and RadioButton Pin
Suthagar.p25-Nov-09 21:56
Suthagar.p25-Nov-09 21:56 
QuestionHas anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 8:07
fred_21-Oct-09 8:07 
QuestionRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
Mark Salsbery21-Oct-09 8:52
Mark Salsbery21-Oct-09 8:52 
AnswerRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 8:54
fred_21-Oct-09 8:54 
QuestionRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
Mark Salsbery21-Oct-09 8:59
Mark Salsbery21-Oct-09 8:59 
AnswerRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 9:00
fred_21-Oct-09 9:00 
GeneralRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
Mark Salsbery21-Oct-09 9:19
Mark Salsbery21-Oct-09 9:19 
GeneralRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 9:22
fred_21-Oct-09 9:22 
GeneralRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 9:45
fred_21-Oct-09 9:45 
GeneralRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
Mark Salsbery21-Oct-09 10:05
Mark Salsbery21-Oct-09 10:05 
QuestionRadioButton DataBinding, without code-behind Pin
hhrafn21-Oct-09 6:38
hhrafn21-Oct-09 6:38 
QuestionRe: RadioButton DataBinding, without code-behind Pin
Mark Salsbery21-Oct-09 6:51
Mark Salsbery21-Oct-09 6:51 
AnswerRe: RadioButton DataBinding, without code-behind Pin
hhrafn22-Oct-09 0:50
hhrafn22-Oct-09 0:50 
GeneralRe: RadioButton DataBinding, without code-behind Pin
Gideon Engelberth22-Oct-09 5:31
Gideon Engelberth22-Oct-09 5:31 
GeneralRe: RadioButton DataBinding, without code-behind Pin
Mark Salsbery22-Oct-09 6:13
Mark Salsbery22-Oct-09 6:13 
GeneralRe: RadioButton DataBinding, without code-behind Pin
ausadmin22-Oct-09 9:36
ausadmin22-Oct-09 9:36 
GeneralRe: RadioButton DataBinding, without code-behind Pin
hhrafn23-Oct-09 5:15
hhrafn23-Oct-09 5:15 
QuestionC# Source code to draw the real time graph using Silverlight Pin
Rameshwar Yadav21-Oct-09 2:34
Rameshwar Yadav21-Oct-09 2:34 
QuestionBinding to UserControl's inner item's property without code-behind Pin
hhrafn19-Oct-09 23:43
hhrafn19-Oct-09 23:43 
Questionhow to design page navigation window form using back and next button. Pin
@nisha 2n19-Oct-09 21:43
@nisha 2n19-Oct-09 21:43 
Questionhow to design page navigation window form using back & next button Pin
@nisha 2n19-Oct-09 21:41
@nisha 2n19-Oct-09 21:41 
AnswerRe: how to design page navigation window form using back & next button Pin
Mark Salsbery20-Oct-09 6:27
Mark Salsbery20-Oct-09 6:27 
QuestionError passing List as a parameter to web service Pin
CBenac19-Oct-09 9:17
CBenac19-Oct-09 9:17 
Error passing List as a parameter to web service

This is my second post on the same subject, in an attempt to solve the same problem. I hope this time I've supplied enough and correct information. Given a basic service, it is possible to return a List from the web service using the GetList() method but the compiler gives an error when trying to send the list as a parameter in the SendList() method. Please check the code bellow. I've revised it.

The error is on line # 88 (The compiler error description is at the end of the source code)

Note: I've configured the ServiceReference to return System.Collections.Generic.List although I've tested all possible combinations.

1 namespace SilverlightApplication1.Web
2 {
3 [ServiceContract(Namespace = "")]
4 [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
5 public class Service1
6 {
7 [OperationContract]
8 public List GetList()
9 {
10 // Add your operation implementation here
11 List myList = new List();
12 myList.Add(new People() { name = "AAA", age = 42 });
13 return myList;
14 }
15 [OperationContract]
16 public string SendList(List myList)
17 {
18 return myList[0].name;
19 }
20 }
21
22 public class People
23 {
24 public string name;
25 public int age;
26 }
27 }
28
29
30 "SilverlightApplication1.Home"
31 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
32 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33 xmlnsBig Grin | :-D ="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
34 xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
35 mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
36 Title="Home"
37 Style="{StaticResource PageStyle}">
38
39 <grid x:name="LayoutRoot" &gt;
40="" <scrollviewer="" style="{StaticResource PageScrollViewerStyle}" &gt;
41=""
42="" <stackpanel="" &gt;
43=""
44="" <textblock=""
45="" text="Home">
46 <textblock x:name="ContentText" style="{StaticResource ContentTextStyle}"
47="" text="Home page content">
48
49
50
51
52
53
54
55
56
57
58
59
60 namespace SilverlightApplication1
61 {
62 public partial class Home : Page
63 {
64 public Home()
65 {
66 InitializeComponent();
67 }
68
69 private void btnGetList_Click(object sender, RoutedEventArgs e)
70 {
71 ServiceReference1.Service1Client proxy = new SilverlightApplication1.ServiceReference1.Service1Client();
72 proxy.GetListCompleted +=new EventHandler<silverlightapplication1.servicereference1.getlistcompletedeventargs>(proxy_GetListCompleted);
73 proxy.GetListAsync();
74 }
75 // THIS WORKS
76 void proxy_GetListCompleted(object sender, SilverlightApplication1.ServiceReference1.GetListCompletedEventArgs e)
77 {
78 MessageBox.Show(e.Result[0].name + " " + e.Result[0].age.ToString());
79 }
80
81 private void btnSendList_Click(object sender, RoutedEventArgs e)
82 {
83 List<people> myList = new List<people>();
84 myList.Add(new People() { name = "AAA", age = 42 });
85
86 ServiceReference1.Service1Client proxy2 = new SilverlightApplication1.ServiceReference1.Service1Client();
87 proxy2.SendListCompleted += new EventHandler(proxy2_SendListCompleted);
88 proxy2.SendListAsync(myList); // COMPILE ERROR SEE DESCRIPTION BELLOW
89 }
90
91 void proxy2_SendListCompleted(object sender, SilverlightApplication1.ServiceReference1.SendListCompletedEventArgs e)
92 {
93 throw new NotImplementedException();
94 }
95 }
96
97 public class People
98 {
99 public string name;
100 public int age;
101 }
102 }
103

Error 2 Argument '1': cannot convert from 'System.Collections.Generic.List<silverlightapplication1.people>' to 'System.Collections.Generic.List<silverlightapplication1.servicereference1.people>' e:\SilverlightApplication1\Views\Home.xaml.cs 42 34 SilverlightApplication1

Error 1 The best overloaded method match for 'SilverlightApplication1.ServiceReference1.Service1Client.SendListAsync(System.Collections.Generic.List<silverlightapplication1.servicereference1.people>)' has some invalid arguments e:\SilverlightApplication1\Views\Home.xaml.cs 42 13 SilverlightApplication1
AnswerRe: Error passing List as a parameter to web service Pin
Nigel Ferrissey19-Oct-09 10:38
Nigel Ferrissey19-Oct-09 10:38 

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.