You are on page 1of 2

//GETTING APP SIZE

Window.Current.SizeChanged += OnWindowSizeChanged;
...
void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
{
UpdateContent();
}

void UpdateContent()
{
Rect bounds = Window.Current.Bounds;
ReportViewWidth.Text = bounds.Width.ToString();
ReportViewHeight.Text = bounds.Height.ToString();
}
...
Window.Current.SizeChanged += OnWindowSizeChanged;

//ONE LINE GET & SET USING LAMBDA EXPRESSION

public string NewImages


{
get => $"{GlobalSettings.baseAddress}:{GlobalSettings.thumbPort}/
{Images}";
set => NewImages = value;
}

//ENUMS

public enum NotifyType


{
StatusMessage,
ErrorMessage
};

Debug.WriteLine(NotifyType.StatusMessage); //1
Debug.WriteLine(NotifyType.StatusMessage.ToString); //StatusMessage

//NAVIGATIONTO USING FRAME HOLDER

Frame rootFrame = Window.Current.Content as Frame;

//CONNECT A CS TO A XAML.CS

public partial class (Name of xaml.cs) : Page {


...
}

//CHECK FOR INTERNET CONNECTION

public static bool HasInternet()


{
var connectionProfile = NetworkInformation.GetInternetConnectionProfile();
return (connectionProfile != null &&
connectionProfile.GetNetworkConnectivityLevel() ==
NetworkConnectivityLevel.InternetAccess);
}

//GET APP FOLDER LOCATION

var appInstalledFolder =
Windows.ApplicationModel.Package.Current.InstalledLocation;

You might also like