File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 171
171
Grid.Row=" 2"
172
172
Grid.Column=" 0"
173
173
Grid.ColumnSpan=" 5"
174
+ Height =" 500"
174
175
Margin =" 15 0 20 0"
175
176
HorizontalAlignment =" Stretch"
176
- VerticalAlignment =" Stretch"
177
177
ClickAction =" SafetyDisplayWithRelativePath"
178
178
Loaded =" MarkdownViewer_Loaded"
179
- Plugins =" {StaticResource MdXamlPlugins}" />
179
+ Plugins =" {StaticResource MdXamlPlugins}"
180
+ Visibility =" Collapsed" />
180
181
181
- <!-- Put this Grid in the same position as MarkdownViewer -->
182
+ <!-- This Grid is for display progress ring and refresh button. -->
183
+ <!-- And it is also for changing the size of the MarkdownViewer. -->
184
+ <!-- Because VerticalAlignment="Stretch" can cause size issue with MarkdownViewer. -->
182
185
<Grid
183
186
Grid.Row=" 2"
184
187
Grid.Column=" 0"
185
188
Grid.ColumnSpan=" 5"
186
189
Margin =" 15 0 20 0"
187
190
HorizontalAlignment =" Stretch"
188
- VerticalAlignment =" Stretch" >
191
+ VerticalAlignment =" Stretch"
192
+ SizeChanged =" Grid_SizeChanged" >
189
193
<ui : ProgressRing
190
194
x : Name =" RefreshProgressRing"
191
195
Width =" 32"
Original file line number Diff line number Diff line change @@ -185,11 +185,13 @@ private async void RefreshMarkdownViewer()
185
185
if ( string . IsNullOrEmpty ( output ) )
186
186
{
187
187
RefreshButton . Visibility = Visibility . Visible ;
188
+ MarkdownViewer . Visibility = Visibility . Collapsed ;
188
189
}
189
190
else
190
191
{
191
192
RefreshButton . Visibility = Visibility . Collapsed ;
192
193
MarkdownViewer . Markdown = output ;
194
+ MarkdownViewer . Visibility = Visibility . Visible ;
193
195
}
194
196
} ) ;
195
197
}
@@ -212,5 +214,11 @@ private void ThemeManager_ActualApplicationThemeChanged(ModernWpf.ThemeManager s
212
214
}
213
215
} ) ;
214
216
}
217
+
218
+ private void Grid_SizeChanged ( object sender , SizeChangedEventArgs e )
219
+ {
220
+ MarkdownViewer . Height = e . NewSize . Height ;
221
+ MarkdownViewer . Width = e . NewSize . Width ;
222
+ }
215
223
}
216
224
}
You can’t perform that action at this time.
0 commit comments