Category: Silverlight
Silverlight Tip – How to make bold text in a textblock from the CodeBehind

The Problem: You need to conditionally bold text in a text block, but you cannot find any way of doing so

The Cause: For inexplicable reasons, Microsoft chose not to include a FontWeight.Bold in their xaml specification

Read more on Silverlight Tip – How to make bold text in a textblock from the CodeBehind…

Popularity: 2% [?]

By Steve French with 2 comments
How to fix updating problems in your Silverlight application

The Problem: You make changes to your Silverlight Application, but you do not see it reflected when you debug or run the solution.2cv_phil_repair_small

The Cause: While the web project portion of the solution is being compiled and run, the Silverlight project is not being built.  This just happened to me recently.  Visual Studio crashed and somehow the Silverlight project portion of the solution decided to remove itself from the build list.

Read more on How to fix updating problems in your Silverlight application…

Popularity: 1% [?]

By Steve French with 0 comments
How to fix strange errors in silverlight web services

fix you_smallThe Problem: You upload your wonderful Silverlight application to a new server and begin to get all sorts of strange errors, most notably something like this

Message: Unhandled Error in Silverlight 2 Application An exception occurred during the operation, making the result invalid.  Check InnerException for exception details.   at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at StronicoMain.ServerUtil.AddressTypeListCompletedEventArgs.get_Result()
at StronicoMain.Page.proxy_AddressTypeListCompleted(Object sender, AddressTypeListCompletedEventArgs e)
at StronicoMain.ServerUtil.ServerUtilClient.OnAddressTypeListCompleted(Object state)
Line: 1
Char: 1
Code: 0
URI: http://www.servername.com/Silverlight.js

Continue reading “How to fix strange errors in silverlight web services” »

Read more on How to fix strange errors in silverlight web services…

Popularity: 4% [?]

By Steve French with 2 comments
How to fix margins in silverlight

The Problem: You try to set margins the same way in xaml as in xhtml/css.

The Cause:
The margin property in xaml is different than the margin in xhtml/css

The Solution:
Use this bit of info: the margins in xaml go left,top,right,bottom, or clockwise from 9:00.

Read more on How to fix margins in silverlight…

Popularity: 1% [?]

By Steve French with 0 comments
How to fix "Value does not fall within the expected range" error in Silverlight

The Problem: Your code goes about it’s merry way, adding children to parents and so forth when you get the error

Value does not fall within the expected range

The Cause: The problem is caused by two objects having the same name in the same parent. If your canvas has two StackPanels named “spOverlap” then this error is thrown. Why the error message couldn’t just say “Duplicate Name Error” no one knows. I’ve encountered this error when dynamically adding controls to the application.

The Solution (Part 1): The simple way to fix it is to simply name the newly added control with a guid or a ID number of some sort.

The Cause (Part 2): I did in fact do that, and then encountered another error, namely that things were expanding exponentially.

Here’s the situation. I have a main control (call it StronScreen), which will spawn a child control (call it StronTab), which has an event (call it StronEntityAdd) that will add a control (call it StronEntity) to StronScreen. I was adding the event to StronTab every time I spawned it, which meant that there were multiple events attached to StronTab as the user went through the application. It worked fine the first time, by which I mean that it added a single instance of StronEntity to StronScreen. The next time I spawned StronTab (this is a necessary and desirable feature of the application) and call StronEntityAdd TWO instances of StronEntity would be added to StronScreen.

The Solution (Part 2): Create the event handler as null when the page is loaded, and when StronTab is called, check to see if the event is null, and if it is, add it to StronTab. If the event handler is not null, then simply don’t add it.

A hard problem to diagnose, and the application does have to work that way, but that fixes it.

Read more on How to fix "Value does not fall within the expected range" error in Silverlight…

Popularity: 20% [?]

By Steve French with 1 comment
How to solve Unhandled Error in Silverlight Application Code: 2104

I’ve found that I get this error every time I upload a Silverlight application to a new webserver. IIS does not have the correct settings by default.

The Problem: You ftp a Silverlight App to an IIS website, go to the website in a browser, and get the following error:

Read more on How to solve Unhandled Error in Silverlight Application Code: 2104…

Popularity: 20% [?]

By Steve French with 10 comments
A solid meeting

I went to the Silverlight Atlanta Meetup last night and had a very nice time. No answers on my data validation questions mind you, but a useful and engaging meeting. Apparently the next move for the group is to move to more of a conference room situation, which will probably be even farther away.

Read more on A solid meeting…

Popularity: 1% [?]

By Steve French with 0 comments
Silverlight Data validation problems

So – I spent today making one last ditch effort to get the built-in Silverlight data validation to work in my project, all to no avail. I even posted a question on Stack Overflow, and have yet to receive an answer, which is a first for me. I downloaded several of the samples, from Wildermuth, Liberty and others, and they none of them would work out of the box, they all either had strange dependencies or would throw errors on build. I finally gave up and did the validation manually, the most recent version is on the site now. Granted, I’m trying to do remote data objects, so my situation and the examples are a bit different, but it would be nice to have some degree of success with this.

Read more on Silverlight Data validation problems…

Popularity: 1% [?]

By Steve French with 0 comments
Atlanta

I, along with many others apparently, will be waking up incredibly early on Saturday and trekking up to Alpharetta for the Atlanta Silverlight Firestarter. I haven’t been to that many of these events, mostly due to location, but I’ve heard great things about Firestarters. I’ll keep everyone posted.

Read more on Atlanta…

Popularity: 1% [?]

By Steve French with 0 comments
Silverlight Dataform successfully shed

I just uploaded another build of Stronico to the Beta site – I got rid of the dataform method of entering and editing email addresses and phone numbers. Addresses are next!

Read more on Silverlight Dataform successfully shed…

Popularity: 1% [?]

By Steve French with 0 comments