diff --git a/SunnyUI/Style/UIStyles.cs b/SunnyUI/Style/UIStyles.cs
index cfa8e075..764d2f64 100644
--- a/SunnyUI/Style/UIStyles.cs
+++ b/SunnyUI/Style/UIStyles.cs
@@ -250,38 +250,6 @@ namespace Sunny.UI
return (int)style;
}
- ///
- /// 注册窗体
- ///
- /// GUID
- /// 窗体
- public static bool Register(Guid guid, UIForm form)
- {
- if (!Forms.ContainsKey(guid))
- {
- Forms.Upsert(guid, form);
- return true;
- }
-
- return false;
- }
-
- ///
- /// 注册页面
- ///
- /// GUID
- /// 页面
- public static bool Register(Guid guid, UIPage page)
- {
- if (!Pages.ContainsKey(guid))
- {
- Pages.Upsert(guid, page);
- return true;
- }
-
- return false;
- }
-
///
/// 注册窗体
///
@@ -366,20 +334,6 @@ namespace Sunny.UI
Pages.TryRemove(page.Guid, out _);
}
- ///
- /// 反注册窗体、页面
- ///
- /// GUID
- public static void UnRegister(Guid guid)
- {
- if (Forms.ContainsKey(guid))
- Forms.TryRemove(guid, out _);
-
- if (Pages.ContainsKey(guid))
- Pages.TryRemove(guid, out _);
-
- }
-
///
/// 获取主题样式
///
@@ -428,6 +382,11 @@ namespace Sunny.UI
form.SetInheritedStyle(style);
}
+ foreach (var form in Forms2.Values)
+ {
+ form.SetInheritedStyle(style);
+ }
+
foreach (var page in Pages.Values)
{
page.SetInheritedStyle(style);
@@ -447,6 +406,12 @@ namespace Sunny.UI
form.SetDPIScale();
}
+ foreach (var form in Forms2.Values)
+ {
+ if (UIDPIScale.NeedSetDPIFont())
+ form.SetDPIScale();
+ }
+
foreach (var page in Pages.Values)
{
if (UIDPIScale.NeedSetDPIFont())
@@ -460,6 +425,11 @@ namespace Sunny.UI
{
form.Translate();
}
+
+ foreach (var form in Forms2.Values)
+ {
+ form.Translate();
+ }
}
}
}