I am designing the architecture for a module where a search takes place. the search takes some time, and I would like to have the UI to be responsive, so I get to delegate the retrieval of the data to a class that will do the search on a separate thread.
然后,我想到两个选择:
either 1° : the search method returns a viewmodel with empty data as a return value (place holder), but once the search process is over, the viewmodel s members will be updated and the result displayed on screen thanks to data binding,
2°:搜查方法没有回归类型,但一旦查询过程结束,就会提出事件,如果出现增益,则会采用带有最后价值的观点。 (最终按观点计算)
这里的任何想法?
EDIT:当然,解决办法1°Im指的是WPF数据,对搜索结果“持单人”物体返回的物体具有约束力。