*UIPage:增加NeedReload,页面切换是否需要重载Load

This commit is contained in:
Sunny 2021-12-30 13:48:07 +08:00
parent 513eaf959d
commit ea5599fe7d
2 changed files with 16 additions and 2 deletions

Binary file not shown.

View File

@ -23,6 +23,7 @@
* 2021-08-17: V3.0.6 TitleFont属性 * 2021-08-17: V3.0.6 TitleFont属性
* 2021-08-24: V3.0.6 OnLoad在加载时重复加载两次的问题 * 2021-08-24: V3.0.6 OnLoad在加载时重复加载两次的问题
* 2021-12-01: V3.0.9 FeedBack和SetParam函数 * 2021-12-01: V3.0.9 FeedBack和SetParam函数
* 2021-12-30: V3.0.9 NeedReloadLoad
******************************************************************************/ ******************************************************************************/
using System; using System;
@ -31,7 +32,6 @@ using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Drawing.Design; using System.Drawing.Design;
using System.Windows.Forms; using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace Sunny.UI namespace Sunny.UI
{ {
@ -292,9 +292,23 @@ namespace Sunny.UI
public void ReLoad() public void ReLoad()
{ {
if (IsShown) OnLoad(EventArgs.Empty); if (IsShown)
{
if (NeedReload)
OnLoad(EventArgs.Empty);
else
Init();
}
} }
/// <summary>
/// 字体颜色
/// </summary>
[Description("页面切换是否需要重载Load"), Category("SunnyUI")]
[DefaultValue(false)]
public bool NeedReload { get; set; }
// private void EventLoad() // private void EventLoad()
// { // {
// Type type = this.GetType().BaseType; // Type type = this.GetType().BaseType;