Thread
Thread th = new Thread(new ThreadStart(functionSample));
th.Start();
private void functionSample()
{
}
Thread 인자 전달
// Type - 1
Thread th = new Thread(() => functionSample("전자기린", 29));
th.Start();
private void functionSample(string name, int age)
{
}
// Type - 2
Thread th = new Thread(new ParameterizedThreadStart(functionSample));
th.Start("전자기린");
private void functionSample(object _name)
{
string name = _name as string;
}
BeginInvoke - 비동기
Application.Current.Dispatcher.BeginInvoke(
System.Windows.Threading.DispatcherPriority.Normal,
new Action(delegate
{
}));
//xamarin.forms
Device.BeginInvokeOnMainThread(() => {
});
Invoke - 동기
Application.Current.Dispatcher.Invoke(
System.Windows.Threading.DispatcherPriority.Normal,
new Action(delegate
{
}));