Skip to content

Commit 37008a4

Browse files
committed
feedbacks addressed
1 parent 11fe2ef commit 37008a4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Custom-password-dialog-box/MainWindow.xaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
77
xmlns:local="clr-namespace:CustomPasswordDialog"
88
mc:Ignorable="d"
9-
Title="MainWindow" WindowState="Maximized" Loaded="Window_Loaded">
9+
Title="MainWindow" WindowState="Maximized">
1010
<Grid>
1111
<Grid.RowDefinitions>
12-
<RowDefinition Height="50"/>
12+
<RowDefinition Height="40"/>
1313
<RowDefinition Height="*"/>
1414
</Grid.RowDefinitions>
1515
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="0">
1616
<Button x:Name="openPDFbutton"
1717
Content="Open PDF"
18-
Height="30"
19-
Width="100"
18+
Width="70"
2019
Margin="5"
2120
Click="openPDFbutton_Click"/>
2221
</StackPanel>

Custom-password-dialog-box/MainWindow.xaml.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ public partial class MainWindow : Window
1919
public MainWindow()
2020
{
2121
InitializeComponent();
22+
pdfViewer.DocumentLoaded += PdfViewer_DocumentLoaded;
2223
}
23-
private void Window_Loaded(object sender, RoutedEventArgs e)
24+
25+
private void PdfViewer_DocumentLoaded(object sender, EventArgs args)
2426
{
2527
DocumentToolbar toolbar = pdfViewer.Template.FindName("PART_Toolbar", pdfViewer) as DocumentToolbar;
2628
ToggleButton FileButton = (ToggleButton)toolbar.Template.FindName("PART_FileToggleButton", toolbar);
2729

30+
//Iterating the File Context menu and hides the Open button
2831
ContextMenu FileContextMenu = FileButton.ContextMenu;
2932
foreach (MenuItem FileMenuItem in FileContextMenu.Items)
3033
{

0 commit comments

Comments
 (0)