1

我不确定如何处理这种行为,这是我拥有的功能:

public class HolderFeature : Feature<HolderState>
    {
        public override string GetName() => "HolderState";
        protected override HolderState GetInitialState() => new(holder: new ProductHolder(), persons: string.Empty);        
    }

而且,在刷新页面(按 f5)之前一切正常,状态被清除,我有这个来处理错误:

 protected override void OnInitialized()
        {
            if (HolderState.Value.QuotedProduct.Quotes != null)
            {
                //do the logic
            }
            else
            {
              //show error screen
                PressedF5 = true;
            }
        }

我期望的是,即使页面被刷新,它也不应该清除状态。我怎样才能做到这一点?

4

0 回答 0