로딩
요청 처리 중입니다...

[WPF] 스레드로 인한 NotSupportedException 예외 해결 방법

 [WPF] 스레드로 인한 NotSupportedException 예외 해결 방법

using System.Collections.ObjectModel; using System.Threading; namespace ThreadError { public class MainWindowVM { ObservableCollection items; Thread thread; public ObservableCollection Items { get { return items; } set { items = value; } } public MainWindowVM() { Items = new ObservableCollection(); Items.Add(0); Items.Add(1); Items.Add(2); thread = new Thread(ThreadMethod); thread.IsBackground = true; thread.Start(); } private void ThreadMethod() { for(int i = 3; i < 100; i++) { I...

# Dispatcher # NotSupportedException # UI스레드 # 스레드예외처리 # 작업스레드