private MapWindow(MapDrawer drawer, bool background) { this.drawer = drawer; this.thread = new Thread(ThreadFunction); thread.SetApartmentState(ApartmentState.STA); thread.IsBackground = background; thread.Start(); }
public static MapWindow Instance(MapDrawer drawer = null, bool background = true) { if (instance == null) { if (drawer != null) { instance = new MapWindow(drawer, background); } else { instance = new MapWindow(new MapDrawer(), background); } } return instance; }