示例#1
0
        private void CleanUp()
        {
            routineHandler.Cancel();
            status.Release();
            status.Value = AsyncOperationStatus.None;

            progress.Release();
            progress.Value = 0;

            isReady.Release();
            isReady.Value = false;

            reference = null;

            value.Release();
        }
        private void InitialSetup()
        {
            _isInitialized.Value = true;
            _status.Value        = ViewStatus.None;

            _viewModelLifeTime.AddTo(LifeTime);
            _progressLifeTime.AddTo(LifeTime);

            LifeTime.AddCleanUpAction(() =>
            {
                _isInitialized.Value = false;
                IsTerminated         = true;
                ViewModel            = null;
                SetStatus(ViewStatus.Closed);
                _status.Release();
                _visibility.Release();
            });
        }