fix(Semantic): 修复 Window 宿主 Dialog 语义样式跨根级联失效并完善示例文案

This commit is contained in:
chinboy
2026-09-13 14:49:19 +08:00
parent 6ff2741a7a
commit eb8270b7ad
30 changed files with 1459 additions and 628 deletions
@@ -81,10 +81,13 @@ public enum ModalShowCaseLangResourceKind
SemanticFooterDescription,
SemanticCloseDescription,
SemanticStageHint,
SemanticPreviewTitleText,
SemanticPreviewFooterLink,
SemanticStylesTitle,
SemanticStylesDescription,
P2ContentOpenMessageBox,
P2TextOverlayHost
P2TextOverlayHost,
SemanticWindowStageHint,
SemanticStylesHint,
SemanticStylesOpenStyledDialog,
SemanticStylesOpenStyledMessageBox,
SemanticStylesOpenStyledWindowDialog
}
@@ -126,11 +126,6 @@
<source>Open CustomView Dialog</source>
</segment>
</unit>
<unit id="P2ContentOpenMessageBox">
<segment>
<source>Open MessageBox</source>
</segment>
</unit>
<unit id="P2ContentOpenModal">
<segment>
<source>Open Modal</source>
@@ -366,11 +361,6 @@
<source>More</source>
</segment>
</unit>
<unit id="SemanticPreviewTitleText">
<segment>
<source>Semantic Part preview</source>
</segment>
</unit>
<unit id="SemanticRootDescription">
<segment>
<source>Root element: the Dialog owner itself, carrying the opening intent, content, result and events.</source>
@@ -386,6 +376,26 @@
<source>Style Dialog and MessageBox Semantic Parts through the generated Semantic Style classes.</source>
</segment>
</unit>
<unit id="SemanticStylesHint">
<segment>
<source>Open the semantically styled Dialog, MessageBox and window-hosted Dialog:</source>
</segment>
</unit>
<unit id="SemanticStylesOpenStyledDialog">
<segment>
<source>Open styled Dialog</source>
</segment>
</unit>
<unit id="SemanticStylesOpenStyledMessageBox">
<segment>
<source>Open styled MessageBox</source>
</segment>
</unit>
<unit id="SemanticStylesOpenStyledWindowDialog">
<segment>
<source>Open styled window Dialog</source>
</segment>
</unit>
<unit id="SemanticStylesTitle">
<segment>
<source>Custom Semantic Part styling</source>
@@ -396,6 +406,11 @@
<source>Title element: title text typography and foreground color.</source>
</segment>
</unit>
<unit id="SemanticWindowStageHint">
<segment>
<source>Open the native Window host with the stage button: parts highlight inside that window; the styled window opens from the styling example.</source>
</segment>
</unit>
<unit id="SemanticWrapperDescription">
<segment>
<source>Wrapper element: the surface motion and transition container.</source>
@@ -151,12 +151,6 @@
<target state="translated">Abrir CustomView Diálogo</target>
</segment>
</unit>
<unit id="P2ContentOpenMessageBox">
<segment>
<source>Open MessageBox</source>
<target state="translated">Abrir MessageBox</target>
</segment>
</unit>
<unit id="P2ContentOpenModal">
<segment>
<source>Open Modal</source>
@@ -439,12 +433,6 @@
<target state="translated">Mais</target>
</segment>
</unit>
<unit id="SemanticPreviewTitleText">
<segment>
<source>Semantic Part preview</source>
<target state="translated">Pré-visualização de Semantic Part</target>
</segment>
</unit>
<unit id="SemanticRootDescription">
<segment>
<source>Root element: the Dialog owner itself, carrying the opening intent, content, result and events.</source>
@@ -463,6 +451,30 @@
<target state="translated">Estilize as Semantic Parts do Dialog e do MessageBox com as classes Semantic Style geradas.</target>
</segment>
</unit>
<unit id="SemanticStylesHint">
<segment>
<source>Open the semantically styled Dialog, MessageBox and window-hosted Dialog:</source>
<target state="translated">Abra o Dialog, o MessageBox e o Dialog em janela com estilos semânticos:</target>
</segment>
</unit>
<unit id="SemanticStylesOpenStyledDialog">
<segment>
<source>Open styled Dialog</source>
<target state="translated">Abrir Dialog estilizado</target>
</segment>
</unit>
<unit id="SemanticStylesOpenStyledMessageBox">
<segment>
<source>Open styled MessageBox</source>
<target state="translated">Abrir MessageBox estilizado</target>
</segment>
</unit>
<unit id="SemanticStylesOpenStyledWindowDialog">
<segment>
<source>Open styled window Dialog</source>
<target state="translated">Abrir Dialog em janela estilizado</target>
</segment>
</unit>
<unit id="SemanticStylesTitle">
<segment>
<source>Custom Semantic Part styling</source>
@@ -475,6 +487,12 @@
<target state="translated">Elemento de título: tipografia e cor do texto do título.</target>
</segment>
</unit>
<unit id="SemanticWindowStageHint">
<segment>
<source>Open the native Window host with the stage button: parts highlight inside that window; the styled window opens from the styling example.</source>
<target state="translated">Abra o host Window nativo com o botão do palco: as partes são destacadas dentro dessa janela; a janela estilizada abre pelo exemplo de estilos.</target>
</segment>
</unit>
<unit id="SemanticWrapperDescription">
<segment>
<source>Wrapper element: the surface motion and transition container.</source>
@@ -151,12 +151,6 @@
<target state="translated">打开自定义视图对话框</target>
</segment>
</unit>
<unit id="P2ContentOpenMessageBox">
<segment>
<source>Open MessageBox</source>
<target state="translated">打开 MessageBox</target>
</segment>
</unit>
<unit id="P2ContentOpenModal">
<segment>
<source>Open Modal</source>
@@ -439,12 +433,6 @@
<target state="translated">更多</target>
</segment>
</unit>
<unit id="SemanticPreviewTitleText">
<segment>
<source>Semantic Part preview</source>
<target state="translated">语义部件预览</target>
</segment>
</unit>
<unit id="SemanticRootDescription">
<segment>
<source>Root element: the Dialog owner itself, carrying the opening intent, content, result and events.</source>
@@ -463,6 +451,30 @@
<target state="translated">通过生成的 Semantic Style 类定制 Dialog 与 MessageBox 的语义部件。</target>
</segment>
</unit>
<unit id="SemanticStylesHint">
<segment>
<source>Open the semantically styled Dialog, MessageBox and window-hosted Dialog:</source>
<target state="translated">分别打开语义样式定制后的 Dialog、MessageBox 与窗口宿主 Dialog:</target>
</segment>
</unit>
<unit id="SemanticStylesOpenStyledDialog">
<segment>
<source>Open styled Dialog</source>
<target state="translated">打开样式化 Dialog</target>
</segment>
</unit>
<unit id="SemanticStylesOpenStyledMessageBox">
<segment>
<source>Open styled MessageBox</source>
<target state="translated">打开样式化 MessageBox</target>
</segment>
</unit>
<unit id="SemanticStylesOpenStyledWindowDialog">
<segment>
<source>Open styled window Dialog</source>
<target state="translated">打开样式化窗口 Dialog</target>
</segment>
</unit>
<unit id="SemanticStylesTitle">
<segment>
<source>Custom Semantic Part styling</source>
@@ -475,6 +487,12 @@
<target state="translated">标题元素:标题文字的排版与前景色。</target>
</segment>
</unit>
<unit id="SemanticWindowStageHint">
<segment>
<source>Open the native Window host with the stage button: parts highlight inside that window; the styled window opens from the styling example.</source>
<target state="translated">用舞台内按钮打开原生 Window 宿主:部件高亮发生在该窗口内;样式化窗口由样式示例的按钮打开。</target>
</segment>
</unit>
<unit id="SemanticWrapperDescription">
<segment>
<source>Wrapper element: the surface motion and transition container.</source>
@@ -151,12 +151,6 @@
<target state="translated">打開自定義視圖對話框</target>
</segment>
</unit>
<unit id="P2ContentOpenMessageBox">
<segment>
<source>Open MessageBox</source>
<target state="translated">開啟 MessageBox</target>
</segment>
</unit>
<unit id="P2ContentOpenModal">
<segment>
<source>Open Modal</source>
@@ -439,12 +433,6 @@
<target state="translated">更多</target>
</segment>
</unit>
<unit id="SemanticPreviewTitleText">
<segment>
<source>Semantic Part preview</source>
<target state="translated">語意部件預覽</target>
</segment>
</unit>
<unit id="SemanticRootDescription">
<segment>
<source>Root element: the Dialog owner itself, carrying the opening intent, content, result and events.</source>
@@ -463,6 +451,30 @@
<target state="translated">透過生成的 Semantic Style 類別自訂 Dialog 與 MessageBox 的語意部件。</target>
</segment>
</unit>
<unit id="SemanticStylesHint">
<segment>
<source>Open the semantically styled Dialog, MessageBox and window-hosted Dialog:</source>
<target state="translated">分別開啟語意樣式定制後的 Dialog、MessageBox 與視窗宿主 Dialog:</target>
</segment>
</unit>
<unit id="SemanticStylesOpenStyledDialog">
<segment>
<source>Open styled Dialog</source>
<target state="translated">開啟樣式化 Dialog</target>
</segment>
</unit>
<unit id="SemanticStylesOpenStyledMessageBox">
<segment>
<source>Open styled MessageBox</source>
<target state="translated">開啟樣式化 MessageBox</target>
</segment>
</unit>
<unit id="SemanticStylesOpenStyledWindowDialog">
<segment>
<source>Open styled window Dialog</source>
<target state="translated">開啟樣式化視窗 Dialog</target>
</segment>
</unit>
<unit id="SemanticStylesTitle">
<segment>
<source>Custom Semantic Part styling</source>
@@ -475,6 +487,12 @@
<target state="translated">標題元素:標題文字的字型與前景色。</target>
</segment>
</unit>
<unit id="SemanticWindowStageHint">
<segment>
<source>Open the native Window host with the stage button: parts highlight inside that window; the styled window opens from the styling example.</source>
<target state="translated">用舞台內按鈕開啟原生 Window 宿主:部件高亮發生在該視窗內;樣式化視窗由樣式範例的按鈕開啟。</target>
</segment>
</unit>
<unit id="SemanticWrapperDescription">
<segment>
<source>Wrapper element: the surface motion and transition container.</source>
@@ -156,6 +156,22 @@ public class ModalViewModel : ReactiveObject, IRoutableViewModel
set => this.RaiseAndSetIfChanged(ref _isMessageBoxSemanticStyleOpen, value);
}
private bool _isWindowDialogSemanticOpen;
public bool IsWindowDialogSemanticOpen
{
get => _isWindowDialogSemanticOpen;
set => this.RaiseAndSetIfChanged(ref _isWindowDialogSemanticOpen, value);
}
private bool _isWindowDialogStyledOpen;
public bool IsWindowDialogStyledOpen
{
get => _isWindowDialogStyledOpen;
set => this.RaiseAndSetIfChanged(ref _isWindowDialogStyledOpen, value);
}
public ModalViewModel(IScreen screen)
{
HostScreen = screen;
File diff suppressed because it is too large Load Diff
@@ -75,6 +75,12 @@ public partial class ModalShowCase : GalleryReactiveUserControl<ModalViewModel>
case "MessageBoxSemanticStyleOpenButton":
HandleMessageBoxSemanticStyleOpenButtonClick(button, e);
break;
case "WindowDialogSemanticOpenButton":
HandleWindowDialogSemanticOpenButtonClick(button, e);
break;
case "WindowDialogStyledOpenButton":
HandleWindowDialogStyledOpenButtonClick(button, e);
break;
case "MessageBoxOverlayHostButton":
HandleMessageBoxOverlayHostButtonClick(button, e);
break;
@@ -231,6 +237,22 @@ public partial class ModalShowCase : GalleryReactiveUserControl<ModalViewModel>
}
}
private void HandleWindowDialogSemanticOpenButtonClick(object? sender, RoutedEventArgs e)
{
if (DataContext is ModalViewModel viewModel)
{
viewModel.IsWindowDialogSemanticOpen = true;
}
}
private void HandleWindowDialogStyledOpenButtonClick(object? sender, RoutedEventArgs e)
{
if (DataContext is ModalViewModel viewModel)
{
viewModel.IsWindowDialogStyledOpen = true;
}
}
private void HandleSemanticStyleDialogOpenButtonClick(object? sender, RoutedEventArgs e)
{
if (DataContext is ModalViewModel viewModel)