Category: C#

C# Compiler Warning – CS4025 the callerfilepathattribute applied to p

In this blog post, you’ll learn more about the C# Compiler Warning – CS4025 and the related message description C# Compiler Warning Code CS4025 C# Compiler Description for the Code :CS4025 The CallerFilePathAttribute applied to parameter ‘{0}’ will have no effect because it applies to a member that is used in contexts that do not allow optional arguments

IsolatedStorage File or Windows Storage APIs – Which one to Use for WP8 App?

The Windows Phone 8 SDK includes the Windows Storage API which can be used in the Windows Phone 8 app to store and retrieve data from the Storage. The Windows Phone 7 SDK already provided the IsolatedStorage APIs. Which one to use? IsolatedStorage File or Windows Storage API. The answer is simple. If you are targeting the Windows Phone 8 mainly, then the better option…

How to Get the Battery Level from a Windows Phone 8 device using C#?

The Windows Phone 8 SDK provides the Windows.Phone.Devices.Power.Battery class which can be used to retrieve the battery information of the windows phone. Use the Windows.Phone.Devices.Power.Battery.GetDefault ().RemainingChargePercent property to retrieve the Battery Level from a Windows Phone 8 device programatically using C#. How to Get the Battery Level from a Windows Phone 8 device using C#? Below is a sample code snippet demonstrating the steps used…