File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Custom-password-dialog-box Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 6
6
xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
7
7
xmlns : local =" clr-namespace:CustomPasswordDialog"
8
8
mc : Ignorable =" d"
9
- Title =" MainWindow" WindowState =" Maximized" Loaded = " Window_Loaded " >
9
+ Title =" MainWindow" WindowState =" Maximized" >
10
10
<Grid >
11
11
<Grid .RowDefinitions>
12
- <RowDefinition Height =" 50 " />
12
+ <RowDefinition Height =" 40 " />
13
13
<RowDefinition Height =" *" />
14
14
</Grid .RowDefinitions>
15
15
<StackPanel Orientation =" Horizontal" HorizontalAlignment =" Center" Grid.Row=" 0" >
16
16
<Button x : Name =" openPDFbutton"
17
17
Content =" Open PDF"
18
- Height =" 30"
19
- Width =" 100"
18
+ Width =" 70"
20
19
Margin =" 5"
21
20
Click =" openPDFbutton_Click" />
22
21
</StackPanel >
Original file line number Diff line number Diff line change @@ -19,12 +19,15 @@ public partial class MainWindow : Window
19
19
public MainWindow ( )
20
20
{
21
21
InitializeComponent ( ) ;
22
+ pdfViewer . DocumentLoaded += PdfViewer_DocumentLoaded ;
22
23
}
23
- private void Window_Loaded ( object sender , RoutedEventArgs e )
24
+
25
+ private void PdfViewer_DocumentLoaded ( object sender , EventArgs args )
24
26
{
25
27
DocumentToolbar toolbar = pdfViewer . Template . FindName ( "PART_Toolbar" , pdfViewer ) as DocumentToolbar ;
26
28
ToggleButton FileButton = ( ToggleButton ) toolbar . Template . FindName ( "PART_FileToggleButton" , toolbar ) ;
27
29
30
+ //Iterating the File Context menu and hides the Open button
28
31
ContextMenu FileContextMenu = FileButton . ContextMenu ;
29
32
foreach ( MenuItem FileMenuItem in FileContextMenu . Items )
30
33
{
You can’t perform that action at this time.
0 commit comments