我使用后台进程和 MVP 模式开发应用程序。我可以像这样在 ModelProcess (Model) 中存储进程状态(isCanceled、isStarted 或 isPaused)吗:
public event EventHandler CancelChanged;
bool isCanceled = false;
public bool IsCanceled
{
get { return isCanceled; }
set
{
isCanceled = value;
if (isCanceled)
{
if (CancelChanged != null)
{
CancelChanged(this, EventArgs.Empty);
}
}
}
}