Skip to main content

Posts

Showing posts with the label Silverlight

Workaround for Visibility.Hidden in Silverlight

I love working on XAML/Silverlight and I don't face any issues most of the times. But when I am in trouble, I don't find any clue on how to come out of that. Recently, I am working on a Silverlight application and got a requirement to apply background color for Items which contains Collapsible Controls. To Understand this properly, I have a list of CheckBoxes with TextBox Controls and the TextBox should only be visible on CheckBox Check. To accomplish this, I simply Binded the Visibility of TextBox with IsChecked Property and thats working like charm. The problem is when I apply BackgroundColor to those Items. If I apply a BackgroundColor to ListItem in Template, It is taking only till CheckBox content, if there is no TextBox (i.e., CheckBox is Unchecked). Now I came to know the importance of Hidden in the Visibility Values. But soon I found that its not supported in Silverlight. The only work around for this is to manipulate Opacity of the TextBox instead of Visibility....

extendedProtectionPolicy tag problem: Workaround

When one use Windows7 to generate a WCF configuration file/ proxy that will generate some extra lines of code which will cause the problems in running the application. The extra lines generated are not supported in Silverlight/WPF environment. Those lines will look like <transport>      <extendedprotectionpolicy policyenforcement = "Never" /> </transport> There are some limitations for silverlight & WPF to use custombinding. You can read an article related to this at http://msdn.microsoft.com/en-us/library/cc896571(VS.95).aspx Workaround: Those extra tags can be deleted or commented to run the application.

Sys.InvalidOperationException: InitializeError Error #2104

I started development in silverlight recently. When everything is installed, i just started with a test application and on running the site i got the following exception. Microsoft JScript runtime error: Sys.InvalidOperationException: InitializeError error #2104 in control 'Xaml1': Could not download the Silverlight application. Check web server settings I am surprised to see this error as all the required things are installed. But I missed one small thing. That is to add silverlight application MIME type to the web server(IIS). After adding this MIME type, my application run without any error. Steps to add MIME type in IIS6: 1) Goto the silverlight web application/ website properties. 2) Open HTTP Headers Tab and find MIME types region. 3) Click MIME Type button and add new MIME type 4) Type .xap and application/x-silverlight-app as extension and MIME types respectively. 5) Save your settings. This will add silverlight mime type to the sever, so that our application run wit...