How do I tell WCF to skip verification of the certificate?

You might be able to achieve this in Silverlight by allowing cross-domain communication between the web server the hosts the Silverlight application and the remote WCF service. In that case you need to place a clientaccesspolicy.xml file at the root of the domain where the WCF service is hosted: <?xml version=”1.0″ encoding=”utf-8″?> <access-policy> <cross-domain-access> <policy> … Read more

Iterating through an enumeration in Silverlight?

Or maybe strongly typed using linq, like this: public static T[] GetEnumValues<T>() { var type = typeof(T); if (!type.IsEnum) throw new ArgumentException(“Type ‘” + type.Name + “‘ is not an enum”); return ( from field in type.GetFields(BindingFlags.Public | BindingFlags.Static) where field.IsLiteral select (T)field.GetValue(null) ).ToArray(); } public static string[] GetEnumStrings<T>() { var type = typeof(T); if … Read more

How do I raise an event in a usercontrol and catch it in mainpage?

Check out Event Bubbling — http://msdn.microsoft.com/en-us/library/aa719644%28vs.71%29.aspx Example: User Control public event EventHandler StatusUpdated; private void FunctionThatRaisesEvent() { //Null check makes sure the main page is attached to the event if (this.StatusUpdated != null) this.StatusUpdated(this, new EventArgs()); } Main Page/Form public void MyApp() { //USERCONTROL = your control with the StatusUpdated event this.USERCONTROL.StatusUpdated += new EventHandler(MyEventHandlerFunction_StatusUpdated); … Read more

What is the difference for TargetType=”{x:Type Button}” and TargetType=”Button”?

The XAML designer applies inbuilt type converters that convert the string value “Button” to System.Type which is Button , which makes it seem like there is no practical difference. However one should practise to use the explicit Type specification using x:Type. Explicit Type specification is required is when we inherit Styles using BasedOn, there implicit … Read more