public void SetDirty() { if (this.IsDirty) { NavController?.Unlock(); this.DirtyExit = false; } else { NavController?.Lock(); this.DirtyExit = true; } this.IsDirty = !this.IsDirty; this.InvokeAsync(this.StateHasChanged); }