Category: C#

UnauthorizedAccessException or unhandled Exception when accessing Geolocator in Windows Phone

When using the Geolocator GetGeopositionAsync () method, it is necessary to handle the necessary exceptions that may arise based on various scenarios. One such scenario is the Location is disabled by the use in the Phone Settings. In this case, when the Geolocator’s GetGeopositionAsync() method is called, you will receive the UnauthorizedAccessException or unhandled Exception as shown below. “An exception of type ‘System.Exception’ occurred in…

How to Get the Path to special folder using C# ?

If you want to get the path to the special of the user like My Documents etc. , you can use the Environment.GetFolder with the enum “Environment.SpecialFolder”. How to Get the Path to special folder using C# ? Below is a sample code snippet demonstrating on how to do it.

How to find the MaxValue and MinValue of UInt16 in C# ?

You can find the max value and min value of the unsigned integer in c# using the properties UInt16.MaxValue and UInt16.MinValue . Below is a sample sourcecode demonstrating the MaxValue and MinValue of UInt16 in C# Output Max value for UInt16 : 65535Min value for UInt16 : 0

How to Skip Iteration of a foreach loop in C# ?

When using C# programming language , there are times when you might want to skip over the iteration based on some condition and jump over to the next iteration. How to Skip Iteration of a foreach loop in C# ? continue keyword comes to your rescue for this use case. When you want to skip the processing of current iteration and jump to the next…

C# Compiler Warning – CS0473 explicit interface implementation ‘{0}’

In this blog post, you’ll learn more about the C# Compiler Warning – CS0473 and the related message description C# Compiler Warning Code CS0473 C# Compiler Description for the Code :CS0473 Explicit interface implementation ‘{0}’ matches more than one interface member. Which interface member is actually chosen is implementation-dependent. Consider using a non-explicit implementation instead.

How to Add Border to the Ellipse Control in Windows Phone 8 ?

Looking for an option to add border with a different color to the Ellipse Control in Windows Phone 8 ? Here’s a simple way to do it. How to Add Border to the Ellipse Control in Windows Phone 8 ? Assume that the Ellipse tag in the XAML is as shown below. The Ellipse has the background color “Chocolate”. <Ellipse Height=”52″ Width=”52″ Fill=”Chocolate”/> We can…

How do take Screenshot in Windows Phone 8 device?

The Windows Phone 8 allows the users to take screenshot of the current screen. This was a feature that was included in Windows Phone 8. How do take Screenshot in Windows Phone 8 device? 1. Hold the Power button and the Windows Key simultaneously. 2. This will take a screenshot on the Windows Phone 8 device which will be stored in the Screenshots album.