SYSK 397: Xamarin-Forms-Labs CalendarView control is not rendered in Win8 phone

If you downloaded XLabs open source controls from https://github.com/XLabs/Xamarin-Forms-Labs and trying to use them in a Xamarin project targeting Windows phone 8, you may be having “blank” rendering (calendar not displayed) issue – note that the space for the control is taken which can be seen by setting control’s background property.  I had this issue attempting…

0

SYSK 396: FxCop Rules for RESTful API

There are a few well known basic naming rules providing a consistent, understandable REST API services, e.g. The scheme and host name are not case sensitive; however, the path and query should be treated as case sensitive. Lowercase letters are preferred in URI paths.  Do use hyphens (-) between words to improve readability of URI…

0

SYSK 395: DataAnnotations: ConditionallyRequiredAttribute with lamda expressions

Back in 2010, Jeff Hanley published a sample of a ConditionallyRequiredAttribute that used a name of another property for runtime condition verification.  The original source can be found at http://jeffhandley.com/archive/2010/09/26/RiaServicesCustomReusableValidators.aspx.  I took the liberty to update it to support lambda expressions, allowing for more complex rules, e.g. [ConditionallyRequired(typeof(YourClass), “(x) => { return x.Prop1 == 5…

0

SYSK 394: Cost of getting StackTrace and finding a StackFrame

I wanted to find out the overhead of getting the stack trace and finding a specific method in the array of stack frames.  The profiled code looked like this: private static MethodBase GetCallerMethod(string caller) {     StackTrace st = new StackTrace(2);     return (from f in st.GetFrames() let m = f.GetMethod() where m.Name == caller…

0

SYSK 393: Error: Cannot obtain Metadata (RESOLVED)

Not all error messages are created equal, and some of them are less helpful than others.  Here is one I came across —  “Metadata contains a reference that cannot be resolved…  An exception was thrown in a call to a WSDL export extension:System.ServiceModel.Description.DataContractSerializerOperationBehavior contract…  Type ‘YourNamespace.YourClass’ cannot be serialized. Consider marking it with the DataContractAttribute…

0

SYSK 391: Entities as a data contract

There may be instances when using data transfer objects (DTO) is appropriate. For example, if you need to control the serialization details, such as which members to serialize and which not to serialize, and if you need to change the names of the serialized members, or do data contract mapping based on service version, or…

0

SYSK 389: How to set ClientCredentials via Configuration file in Client

I’m working on a project where a service hosted elsewhere requires Windows authentication.  As a consultant, my computer is not on the customer’s domain, so, using my logged-on Windows credentials won’t do any good.  And, doing nothing results in the following exception:  “The caller was not authenticated by the service.” and inner exception is “The…

0

SYSK 387: Resolving Data Type Conversion Error

Consider the following line of code: AttendeeAvailability attendeeAvailability; . . .if (attendeeAvailability.WorkingHours.DaysOfTheWeek.Contains(DateTime.Today.DayOfWeek) == false){   . . . } You’ll get a compile time error — Argument 1: cannot convert from ‘System.DayOfWeek’ to ‘Microsoft.Exchange.WebServices.Data.DayOfTheWeek’   One way to resolve it is by converting it to a string representation and parsing into the Exchange library known data type,…

0

SYSK 386: Performance Implications of Using One vs. Several Nested Hashtables

Let’s say you need to quickly find some reference/lookup data and you decide to use hashtables…  If your key is comprised of several elements, is it better, from the performance point of view for you to combine all of them into one string and use it to access a flat single hashtable, or, would you…

0