|
Try using Mode=OneWay in the CellTemplate and Mode=TwoWay in the
CellEditingTemplate
|
|
|
|
|
Has anyone been able to make a Silverlight socket policy server work with port forwarding? I really don't want to put the computer in the DMZ, ports 80/443 seem to forward but my policy server seems not to work even when the 943 port is forwarded
|
|
|
|
|
fred_ wrote: my policy server seems not to work even when the 943 port is forwarded
What about the actual connection port (4502-4534)....is that being forwarded?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
that works fine. Everything works until Silverlight makes the policy request to open a socket. On my home network works fine. Just won't work from an outside IP
|
|
|
|
|
Sorry if these questions are obvious, but I have to ask...
Does your policy server code ever get hit from outside?
If not, is there a firewall blocking port 943?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
firewall off for test nope seems to hit
|
|
|
|
|
Seems to? You should be able to run in debugger and get a hit on
a breakpoint in the policy server code.
If that succeeds, and the policy server returns a valid policy file
then a connection will be attempted on the specified connection port...
that port will need to be forwarded as well - is it being forwarded?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thats my issue. the Silverlight ports hit, just not 943. Same setting in router forwarding ( obviously besides the port number) and no hit
|
|
|
|
|
actually I re-tested as I've been trhough many interations. The policy sever DOES hit the break point. The client Silverlight app still denies the connection to the server socket.
[edit for typo]
|
|
|
|
|
fred_ wrote: The client Silverlight app still denies the connection to the server socket.
Any exception?
The only thing I can think of is the Silverlight app doesn't like the
returned policy file - either it's malformed or it doesn't permit connections
on the port the Silverlight app is trying to connect to.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I'm trying to do DataBinding in XAML woutout any coudebehind. However I can't find any of the nice Binding features found on most other WPF controls.
What is the most current and prefered way to do databinding on RadioButtons ?
|
|
|
|
|
hhrafn wrote: I can't find any of the nice Binding features found on most other WPF controls
Which properties of the RadioButton control are you
trying to bind to that are missing "the nice Binding
features"?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
well, I'd like to use the radio buttons like this: (in theory at least)
<RadioButtons ItemsSource="{Binding Colors}" />
Then picking up the selected item through a selectedItem binding (?)
Basically my problem is that I need it to be MVVM (no codebehind) and this radio button list will also be dynamic (changeable).
|
|
|
|
|
Well, a RadioButton is not an items control, and I have never heard of a "RadioButtons" control. You might try using an ListBox to allow you to bind the ItemsSource and make a RadioButton in the ItemTemplate. The tricky part will be binding the IsChecked of the RadioButton to the IsSelected on the ListBoxItem.
|
|
|
|
|
In addition to Gideon's reply...
Why are you hung up on not using code behind? What's the difference
between code generated from the XAML and code you write? It's the
same class either way.
You could provide individual bool properties to bind the IsChecked
properties of each radiobutton to.
You could also use a converter to modify the IsChecked properties of the
radiobuttons into some other form, like an enum etc.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm not sure if I totally understand your requirement, however you can certainly use MVVM to support a radio button list. Take a look at "Creating an Internationalized Wizard in WPF" [^], in particular the section "Presenting Options via OptionViewModel". In this example the OptionViewModel is used for CheckBox options and RadioButton options. BTW it can be extended for a Combobox - you will see my thread in the discussions for the article, and Karl's solution.
I hope this helps.
Tim
|
|
|
|
|
Thank you, this solution looks perfect for me
My main requirement in this project is to follow the MVVM pattern, or "total" seperation of View and Code (control).
Thanks again.
|
|
|
|
|
I am new to silverlight and I need to throw the data from the database into real time graph using silverlight technology, pl suggest me how can I achieve this?
|
|
|
|
|
Using WPF, while following the MVVM pattern, I'm constructing a digital version of a paper form.
This paper form has many fields that need to be filled out.
The fields are basicly boxes with the title of the field inside it, then you write the appopriate data into the box.
I was wondering if I should use a UserControl to solve this repedative taks of all these many boxes. All with different titles and data, but having basically the same look.
So I constructed a UserControl with one Label (name="Title") and a TextBox (name="Text").
Now, if I have a ViewModel as DataContext for the form window (which contains all of these UserControl-fields, how can I bind the properties of the ViewModel to the content properties of the Lable and TextBox?
I'm hoping I won't have to add any codebehind to the UserControl just to make Properties.
Is there some nifty thing I can do here?
Am I on the right path even, should I perhaps just stick to datatemplates somehow ? .. or just make one huge form with many many manu labels and textboxes ? 
|
|
|
|
|
hi to all.....
plz help me in....how to design page navigation window form using back and next button......for exmple...if we take a window like install wizard window..in that v use a button name as next.. for go through the next step...like ....sooo can u any one send me that source code...
|
|
|
|
|
hi to all.....
plz help me in....how to design page navigation window form using back and next button......for exmple...if we take a window like install wizard window..in that v use a button name as next.. for go through the next step...like ....sooo can u any one send me that source code...
@nu Gunturi
|
|
|
|
|
|
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 xmlns ="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" >
40="" <scrollviewer="" style="{StaticResource PageScrollViewerStyle}" >
41=""
42="" <stackpanel="" >
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
|
|
|
|
|
I think the problem is that the People objects that you are trying to send are defined on the client side. The service is expecting the People objects that are defined on the service side - they are not the same thing.
Try sending a list of ServiceReference1.People instead of SilverlightApplication1.People and see if you get the same error.
|
|
|
|
|
In addition to Nigel's reply...
Since you're using the automagic proxy generator, then you
can look at the generated code on the client side:
1) Click on the client project in the Solution Explorer
2) Click the "Show All Files" button on the Solution Explorer's toolbar
3) Drill down the files tree from the service reference to find the
Reference.cs file - that will have the generated client-side classes
In the generated code, there should be the People class you should be using.
If it's not there, try using the DataContractAttribute on the server side:
[DataContract]
public class People
{
[DataMember]
public string name;
[DataMember]
public int age;
}
(don't forget to update the service reference on the client to get new
generated code!)
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|