@@ -66,5 +66,53 @@ public async Task ClosingDialogWithIsOpenProperty_ShouldRaiseDialogClosingEvent(
66
66
await Wait . For ( async ( ) => Assert . Equal ( "1" , await resultTextBlock . GetText ( ) ) ) ;
67
67
recorder . Success ( ) ;
68
68
}
69
+
70
+ [ Fact ]
71
+ [ Description ( "Issue 2398" ) ]
72
+ public async Task FontSettingsSholdInheritIntoDialog ( )
73
+ {
74
+ await using var recorder = new TestRecorder ( App ) ;
75
+
76
+ IVisualElement grid = await LoadXaml < Grid > ( @"
77
+ <Grid TextElement.FontSize=""42""
78
+ TextElement.FontFamily=""Times New Roman""
79
+ TextElement.FontWeight=""ExtraBold"">
80
+ <Grid.ColumnDefinitions>
81
+ <ColumnDefinition />
82
+ <ColumnDefinition />
83
+ </Grid.ColumnDefinitions>
84
+ <materialDesign:DialogHost>
85
+ <materialDesign:DialogHost.DialogContent>
86
+ <TextBlock Text=""Some Text"" x:Name=""TextBlock1"" />
87
+ </materialDesign:DialogHost.DialogContent>
88
+ <Button Content=""Show Dialog"" x:Name=""ShowButton1"" Command=""{x:Static materialDesign:DialogHost.OpenDialogCommand}"" />
89
+ </materialDesign:DialogHost>
90
+ <materialDesign:DialogHost Style=""{StaticResource MaterialDesignEmbeddedDialogHost}"" Grid.Column=""1"">
91
+ <materialDesign:DialogHost.DialogContent>
92
+ <TextBlock Text=""Some Text"" x:Name=""TextBlock2"" />
93
+ </materialDesign:DialogHost.DialogContent>
94
+ <Button Content=""Show Dialog"" x:Name=""ShowButton2"" Command=""{x:Static materialDesign:DialogHost.OpenDialogCommand}"" />
95
+ </materialDesign:DialogHost>
96
+ </Grid>" ) ;
97
+ var showButton1 = await grid . GetElement < Button > ( "ShowButton1" ) ;
98
+ var showButton2 = await grid . GetElement < Button > ( "ShowButton2" ) ;
99
+
100
+ await showButton1 . LeftClick ( ) ;
101
+ await showButton2 . LeftClick ( ) ;
102
+ await Task . Delay ( 300 ) ;
103
+
104
+ var text1 = await grid . GetElement < TextBlock > ( "TextBlock1" ) ;
105
+ var text2 = await grid . GetElement < TextBlock > ( "TextBlock2" ) ;
106
+
107
+ Assert . Equal ( 42 , await text1 . GetFontSize ( ) ) ;
108
+ Assert . True ( ( await text1 . GetFontFamily ( ) ) ? . FamilyNames . Values . Contains ( "Times New Roman" ) ) ;
109
+ Assert . Equal ( FontWeights . ExtraBold , await text1 . GetFontWeight ( ) ) ;
110
+
111
+ Assert . Equal ( 42 , await text2 . GetFontSize ( ) ) ;
112
+ Assert . True ( ( await text2 . GetFontFamily ( ) ) ? . FamilyNames . Values . Contains ( "Times New Roman" ) ) ;
113
+ Assert . Equal ( FontWeights . ExtraBold , await text2 . GetFontWeight ( ) ) ;
114
+
115
+ recorder . Success ( ) ;
116
+ }
69
117
}
70
118
}
0 commit comments