I have the below example code for a Windows Phone 7 application, and I am trying to convert it to VB.Net as a starting point. The assignments like this:
Loaded += (_, __) => { anonymousMethodBody();}
are failing to convert when I use a C#-to-VB conversion tool. How should those be translated?
public MainPage()
{
InitializeComponent();
Loaded += (_, __) =>
{
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
cam = new VideoCamera();
cam.Initialized += (___, ____) =>
{
cam.LampEnabled = true;
cam.StartRecording();
};
vCam.SetSource(cam);
new Thread(() =>
{
try
{
var isf = IsolatedStorageFile.GetUserStoreForApplication();
var files = isf.GetFileNames();
foreach (var file in files)
{
Debug.WriteLine("Deleting... " + file);
isf.DeleteFile(file);
}
}
catch (Exception ex)
{
Debug.WriteLine("Error cleaning up isolated storage: " + ex);
}
}).Start();
};
}