MonodroidStockPortfolio/MonoStockPortfolio/Framework/ContextExtensions.cs

14 lines
341 B
C#
Raw Normal View History

using Android.App;
using Android.Content;
namespace MonoStockPortfolio.Framework
{
public static class ContextExtensions
{
public static int GetScreenWidth(this Context @this)
{
var activity = (Activity)@this;
return activity.WindowManager.DefaultDisplay.Width;
}
}
}