Skip to content

Commit bc02bbe

Browse files
947956
1 parent 4bcbb02 commit bc02bbe

File tree

3 files changed

+174
-68
lines changed

3 files changed

+174
-68
lines changed

Toolbar/CustomToolbar/Helper/PdfViewerEventAttachUtil.cs

+3-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ public static void SetWindowLoaded(DependencyObject sender, bool command)
1919
{
2020
sender.SetValue(WindowLoaded, command);
2121
}
22-
22+
/// <summary>
23+
/// Retrieves the parent Window from the given Grid and assigns handlers from the ViewModel.
24+
/// </summary>
2325
public static void WindowLoadedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
2426
{
2527
Grid grid = sender as Grid;
@@ -28,16 +30,12 @@ public static void WindowLoadedChanged(DependencyObject sender, DependencyProper
2830
Window view = grid.Parent as Window;
2931
if (view != null)
3032
{
31-
32-
if (view.ToString().Contains("CustomToolBar"))
33-
{
3433
CustomToolbarViewModel viewModel = view.DataContext as CustomToolbarViewModel;
3534
if (viewModel != null)
3635
{
3736
view.Loaded += new RoutedEventHandler(viewModel.Loaded);
3837
view.Closed += new EventHandler(viewModel.Closed);
3938
}
40-
}
4139
}
4240
}
4341
}

Toolbar/CustomToolbar/MainWindow.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@
585585
<cc:PdfViewerControl
586586
Name="pdfviewer"
587587
Grid.Row="1"
588-
ItemSource="{Binding Path=DocumentStream}"
588+
ItemSource="{Binding Path=FilePath}"
589589
ShowToolbar="False" />
590590
</Grid>
591591
</syncfusion:RibbonWindow>

0 commit comments

Comments
 (0)