Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @DevExpressExampleBot
3 changes: 1 addition & 2 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- default badges list -->
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/128658493/24.2.1%2B)
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/E5091)
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)
Expand All @@ -22,7 +21,7 @@ This example uses the [bar actions](https://docs.devexpress.com/WPF/7045/control
<!-- feedback -->
## Does this example address your development requirements/objectives?

[<img src="https://www.devexpress.com/support/examples/i/yes-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=how-to-customize-pdf-viewer-toolbar-items-e5091&~~~was_helpful=yes) [<img src="https://www.devexpress.com/support/examples/i/no-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=how-to-customize-pdf-viewer-toolbar-items-e5091&~~~was_helpful=no)
[<img src="https://www.devexpress.com/support/examples/i/yes-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=wpf-pdf-viewer-customize-toolbar-items&~~~was_helpful=yes) [<img src="https://www.devexpress.com/support/examples/i/no-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=wpf-pdf-viewer-customize-toolbar-items&~~~was_helpful=no)

(you will be redirected to DevExpress.com to submit your response)
<!-- feedback end -->
15 changes: 15 additions & 0 deletions VB/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="DXThemeManager" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<DXThemeManager>
<setting name="ApplicationThemeName" serializeAs="String">
<value>Office2019Colorful</value>
</setting>
</DXThemeManager>
</userSettings>
</configuration>
3 changes: 2 additions & 1 deletion VB/App.xaml.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Imports System.Windows
Imports System.Linq
Imports System.Threading.Tasks

Namespace PdfViewerCustomization

Expand Down
Binary file added VB/Demo.pdf
Binary file not shown.
40 changes: 37 additions & 3 deletions VB/E5091.vbproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,51 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OptionInfer>On</OptionInfer>
<TargetFramework>net8.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<RootNamespace></RootNamespace>
<RootNamespace>
</RootNamespace>
<AssemblyName>PdfViewerCustomization</AssemblyName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>false</UseWindowsForms>
<UseWPF>true</UseWPF>
<UseWindowsForms>False</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<EnableDefaultApplicationDefinition>false</EnableDefaultApplicationDefinition>
</PropertyGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml" />
</ItemGroup>
<ItemGroup>
<None Remove="Demo.pdf" />
</ItemGroup>
<ItemGroup>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Content Include="Demo.pdf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="DevExpress.Images" Version="24.2.*" />
<PackageReference Include="DevExpress.RichEdit.Export" Version="24.2.*" />
<PackageReference Include="DevExpress.Wpf.Reporting" Version="24.2.*" />
<PackageReference Include="DevExpress.Wpf.PdfViewer" Version="24.2.*" />
<PackageReference Include="DevExpress.Wpf.Themes.Office2019Colorful" Version="24.2.*" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Settings.Designer.vb">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
</Project>
51 changes: 31 additions & 20 deletions VB/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
<Window x:Class="PdfViewerCustomization.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/documentviewer"
xmlns:dxpdf="http://schemas.devexpress.com/winfx/2008/xaml/pdf"
xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
Title="MainWindow"
Height="350"
Width="525">
<dxpdf:PdfViewerControl x:Name="viewer" CommandBarStyle="Ribbon">
<Window
x:Class="PdfViewerCustomization.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/documentviewer"
xmlns:dxpdf="http://schemas.devexpress.com/winfx/2008/xaml/pdf"
xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
Title="MainWindow"
Width="1050"
Height="650">
<dxpdf:PdfViewerControl
x:Name="viewer"
CommandBarStyle="Ribbon"
DocumentSource="Demo.pdf">
<dxpdf:PdfViewerControl.CommandProvider>
<dxpdf:PdfCommandProvider>
<dxpdf:PdfCommandProvider.RibbonActions>
<dxb:UpdateAction ElementName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.Ribbon}" PropertyName="ToolbarShowMode" Value="Hide"/>
<dxb:RemoveAction ElementName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.SaveAs}"/>
<dxb:ReplaceAction ElementName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.Close}">
<dxb:BarButtonItem Content="Exit" LargeGlyph="{dx:DXImageOffice2013 Image=Close_32x32.png}"
Command="{Binding ElementName=viewer, Path=CloseDocumentCommand}"/>
<dxb:UpdateAction
ElementName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.Ribbon}"
PropertyName="ToolbarShowMode"
Value="Hide" />
<dxb:RemoveAction ElementName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.SaveAs}" />
<dxb:ReplaceAction ElementName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.Close}">
<dxb:BarButtonItem
Command="{Binding ElementName=viewer, Path=CloseDocumentCommand}"
Content="Exit"
LargeGlyph="{dx:DXImageOffice2013 Image=Close_32x32.png}" />
</dxb:ReplaceAction>
<dxb:InsertAction Index="1" ContainerName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.FileRibbonGroup}">
<dxb:BarButtonItem Content="Save" LargeGlyph="{dx:DXImageOffice2013 Image=SaveAs_32x32.png}"
Command="{Binding ElementName=viewer, Path=SaveAsCommand}"/>
<dxb:InsertAction ContainerName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.FileRibbonGroup}" Index="1">
<dxb:BarButtonItem
Command="{Binding ElementName=viewer, Path=SaveAsCommand}"
Content="Save"
LargeGlyph="{dx:DXImageOffice2013 Image=SaveAs_32x32.png}" />
</dxb:InsertAction>
</dxpdf:PdfCommandProvider.RibbonActions>
</dxpdf:PdfCommandProvider>
Expand Down
4 changes: 2 additions & 2 deletions VB/MainWindow.xaml.vb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Imports System.Windows
Imports System.Linq

Namespace PdfViewerCustomization

Public Partial Class MainWindow
Inherits Window

Public Sub New()
Me.InitializeComponent()
InitializeComponent()
End Sub
End Class
End Namespace
2 changes: 1 addition & 1 deletion VB/Properties/AssemblyInfo.vb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Imports System.Reflection
Imports System.Resources
Imports System.Runtime.InteropServices
Imports System.Windows

' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
Expand Down
23 changes: 9 additions & 14 deletions VB/Properties/Settings.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.