Dailycode.info

Short solution for short problems

Binding doesn't track (pick up) the change if you programatically edit a control.

I'm working on a windows forms application that uses binding to update the contents of the controls. Works like a charm.
When the form got a little more complicated and controls where addedd dynamically, it got a little tricky.
When I changed the value of the controls programatically, the change was not picked up by the bindings. I didn't had to look very long for a solution.
I just added a .Focus or a .Select and then the binding picks up the change.
By example:
 
txtVersion.Text = versionNum.ToString
txtVersion.Select()
or
txtVersion.Text = versionNum.ToString
txtVersion.Focus()

MetaDataResolver not passing binding information

I was trying to get rid of the client configuration for binding and other stuff. One thing I thought of was the MetaDataResolver. This allows you to explore the endpoints from the client on the server if only you know the URL of the mex. So I started implementation of this and soon I got my endpoints. Looping over them and using them. Then suddenly when I do a call to one of the endpoints, I got a exception telling me that the maxReceivedMessageSize was not big enough.  I was positive that I set the maximum on the server configuration. So I looped over the bonding settings coming from the MetaDataResolver.Resolve. There I noticed that the binding information was not passed. After some intensive googling I found that some people said that this information is not passed because of security measurements. So these settings can differ on the server and client.

So now I find myself forced to use the client configuration.

Just passed the EndPoint configuration name to the channel factory and set all the configuration in the config file.

So now I didn’t need the metadataresolver. It can be of use when you want to explore the endpoints and take over the transferable configuration settings. The other settings will be defaulted on your client and you will eventually be forced to raiase the maxRecievedMessageSize.