Skip to content

Commit 7e38ec1

Browse files
877085 How to add new button in Organize panel
1 parent afe8dad commit 7e38ec1

14 files changed

+550
-0
lines changed
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{0C8F46E8-48BD-48FC-9AA2-CE4390DB8D89}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>AddNewToolbarItem</RootNamespace>
10+
<AssemblyName>AddNewToolbarItem</AssemblyName>
11+
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<WarningLevel>4</WarningLevel>
15+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
16+
<Deterministic>true</Deterministic>
17+
<NuGetPackageImportStamp>
18+
</NuGetPackageImportStamp>
19+
</PropertyGroup>
20+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21+
<PlatformTarget>AnyCPU</PlatformTarget>
22+
<DebugSymbols>true</DebugSymbols>
23+
<DebugType>full</DebugType>
24+
<Optimize>false</Optimize>
25+
<OutputPath>bin\Debug\</OutputPath>
26+
<DefineConstants>DEBUG;TRACE</DefineConstants>
27+
<ErrorReport>prompt</ErrorReport>
28+
<WarningLevel>4</WarningLevel>
29+
</PropertyGroup>
30+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
31+
<PlatformTarget>AnyCPU</PlatformTarget>
32+
<DebugType>pdbonly</DebugType>
33+
<Optimize>true</Optimize>
34+
<OutputPath>bin\Release\</OutputPath>
35+
<DefineConstants>TRACE</DefineConstants>
36+
<ErrorReport>prompt</ErrorReport>
37+
<WarningLevel>4</WarningLevel>
38+
</PropertyGroup>
39+
<ItemGroup>
40+
<Reference Include="Syncfusion.Compression.Base, Version=25.1462.35.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
41+
<HintPath>packages\Syncfusion.Compression.Base.25.1.35\lib\net462\Syncfusion.Compression.Base.dll</HintPath>
42+
</Reference>
43+
<Reference Include="Syncfusion.Licensing, Version=25.1462.35.0, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
44+
<HintPath>packages\Syncfusion.Licensing.25.1.35\lib\net462\Syncfusion.Licensing.dll</HintPath>
45+
</Reference>
46+
<Reference Include="Syncfusion.Pdf.Base, Version=25.1462.35.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
47+
<HintPath>packages\Syncfusion.Pdf.Wpf.25.1.35\lib\net462\Syncfusion.Pdf.Base.dll</HintPath>
48+
</Reference>
49+
<Reference Include="Syncfusion.PdfToImageConverter.Base, Version=25.1462.35.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
50+
<HintPath>packages\Syncfusion.PdfToImageConverter.WPF.25.1.35\lib\net462\Syncfusion.PdfToImageConverter.Base.dll</HintPath>
51+
</Reference>
52+
<Reference Include="Syncfusion.PdfViewer.WPF, Version=25.1462.35.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
53+
<HintPath>packages\Syncfusion.PdfViewer.WPF.25.1.35\lib\net462\Syncfusion.PdfViewer.WPF.dll</HintPath>
54+
</Reference>
55+
<Reference Include="Syncfusion.Shared.WPF, Version=25.1462.35.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
56+
<HintPath>packages\Syncfusion.Shared.WPF.25.1.35\lib\net462\Syncfusion.Shared.WPF.dll</HintPath>
57+
</Reference>
58+
<Reference Include="System" />
59+
<Reference Include="System.Data" />
60+
<Reference Include="System.Xml" />
61+
<Reference Include="Microsoft.CSharp" />
62+
<Reference Include="System.Core" />
63+
<Reference Include="System.Xml.Linq" />
64+
<Reference Include="System.Data.DataSetExtensions" />
65+
<Reference Include="System.Net.Http" />
66+
<Reference Include="System.Xaml">
67+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
68+
</Reference>
69+
<Reference Include="WindowsBase" />
70+
<Reference Include="PresentationCore" />
71+
<Reference Include="PresentationFramework" />
72+
</ItemGroup>
73+
<ItemGroup>
74+
<ApplicationDefinition Include="App.xaml">
75+
<Generator>MSBuild:Compile</Generator>
76+
<SubType>Designer</SubType>
77+
</ApplicationDefinition>
78+
<Page Include="MainWindow.xaml">
79+
<Generator>MSBuild:Compile</Generator>
80+
<SubType>Designer</SubType>
81+
</Page>
82+
<Compile Include="App.xaml.cs">
83+
<DependentUpon>App.xaml</DependentUpon>
84+
<SubType>Code</SubType>
85+
</Compile>
86+
<Compile Include="MainWindow.xaml.cs">
87+
<DependentUpon>MainWindow.xaml</DependentUpon>
88+
<SubType>Code</SubType>
89+
</Compile>
90+
</ItemGroup>
91+
<ItemGroup>
92+
<Compile Include="Properties\AssemblyInfo.cs">
93+
<SubType>Code</SubType>
94+
</Compile>
95+
<Compile Include="Properties\Resources.Designer.cs">
96+
<AutoGen>True</AutoGen>
97+
<DesignTime>True</DesignTime>
98+
<DependentUpon>Resources.resx</DependentUpon>
99+
</Compile>
100+
<Compile Include="Properties\Settings.Designer.cs">
101+
<AutoGen>True</AutoGen>
102+
<DependentUpon>Settings.settings</DependentUpon>
103+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
104+
</Compile>
105+
<EmbeddedResource Include="Properties\Resources.resx">
106+
<Generator>ResXFileCodeGenerator</Generator>
107+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
108+
</EmbeddedResource>
109+
<None Include="Data\PDF_Succinctly.pdf" />
110+
<None Include="packages.config" />
111+
<None Include="Properties\Settings.settings">
112+
<Generator>SettingsSingleFileGenerator</Generator>
113+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
114+
</None>
115+
</ItemGroup>
116+
<ItemGroup>
117+
<None Include="App.config" />
118+
</ItemGroup>
119+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
120+
<Import Project="packages\Syncfusion.PdfToImageConverter.WPF.25.1.35\build\net462\Syncfusion.PdfToImageConverter.WPF.targets" Condition="Exists('packages\Syncfusion.PdfToImageConverter.WPF.25.1.35\build\net462\Syncfusion.PdfToImageConverter.WPF.targets')" />
121+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
122+
<PropertyGroup>
123+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
124+
</PropertyGroup>
125+
<Error Condition="!Exists('packages\Syncfusion.PdfToImageConverter.WPF.25.1.35\build\net462\Syncfusion.PdfToImageConverter.WPF.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Syncfusion.PdfToImageConverter.WPF.25.1.35\build\net462\Syncfusion.PdfToImageConverter.WPF.targets'))" />
126+
</Target>
127+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.33627.172
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddNewToolbarItem", "AddNewToolbarItem.csproj", "{0C8F46E8-48BD-48FC-9AA2-CE4390DB8D89}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{0C8F46E8-48BD-48FC-9AA2-CE4390DB8D89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{0C8F46E8-48BD-48FC-9AA2-CE4390DB8D89}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{0C8F46E8-48BD-48FC-9AA2-CE4390DB8D89}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{0C8F46E8-48BD-48FC-9AA2-CE4390DB8D89}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {AFD06165-E840-403D-976F-1DF4321BD6A7}
24+
EndGlobalSection
25+
EndGlobal

Toolbar/AddNewToolbarItem/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" />
5+
</startup>
6+
</configuration>

Toolbar/AddNewToolbarItem/App.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="AddNewToolbarItem.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:AddNewToolbarItem"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>

Toolbar/AddNewToolbarItem/App.xaml.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace AddNewToolbarItem
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Window x:Class="AddNewToolbarItem.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:AddNewToolbarItem"
7+
xmlns:syncfusion="clr-namespace:Syncfusion.Windows.PdfViewer;assembly=Syncfusion.PdfViewer.WPF"
8+
mc:Ignorable="d"
9+
Title="MainWindow" Height="450" Width="800" Loaded="Window_Loaded">
10+
<Grid>
11+
<syncfusion:PdfViewerControl
12+
x:Name="pdfViewer"></syncfusion:PdfViewerControl>
13+
</Grid>
14+
</Window>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using Syncfusion.Windows.PdfViewer;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
using System.Windows.Controls;
9+
using System.Windows.Controls.Primitives;
10+
using System.Windows.Data;
11+
using System.Windows.Documents;
12+
using System.Windows.Input;
13+
using System.Windows.Media;
14+
using System.Windows.Media.Imaging;
15+
using System.Windows.Navigation;
16+
using System.Windows.Shapes;
17+
18+
namespace AddNewToolbarItem
19+
{
20+
/// <summary>
21+
/// Interaction logic for MainWindow.xaml
22+
/// </summary>
23+
public partial class MainWindow : Window
24+
{
25+
Button button;
26+
public MainWindow()
27+
{
28+
InitializeComponent();
29+
pdfViewer.Load(@"../../Data/PDF_Succinctly.pdf");
30+
}
31+
32+
private void Window_Loaded(object sender, RoutedEventArgs e)
33+
{
34+
AddButton();
35+
}
36+
37+
private void AddButton()
38+
{
39+
OutlinePane outlinePane = pdfViewer.Template.FindName("PART_OutlinePane", pdfViewer) as OutlinePane;
40+
ToggleButton thumbnailButton = (ToggleButton)outlinePane.Template.FindName("PART_ThumbnailButton", outlinePane);
41+
thumbnailButton.Checked += ThumbnailButton_Checked;
42+
thumbnailButton.Unchecked += ThumbnailButton_Unchecked;
43+
ThumbnailPane thumbnailPane = pdfViewer.Template.FindName("PART_ThumbnailPanel", pdfViewer) as ThumbnailPane;
44+
StackPanel stack = (StackPanel)thumbnailPane.Template.FindName("Thumb_StackPanel", thumbnailPane);
45+
button = new Button();
46+
button.Margin = new Thickness(10, 0, 0, 0);
47+
button.Width = 35;
48+
button.Height = 24;
49+
button.Content = "New";
50+
stack.Children.Add(button);
51+
}
52+
53+
private void ThumbnailButton_Unchecked(object sender, RoutedEventArgs e)
54+
{
55+
button.Visibility = Visibility.Visible;
56+
}
57+
58+
private void ThumbnailButton_Checked(object sender, RoutedEventArgs e)
59+
{
60+
button.Visibility = Visibility.Collapsed;
61+
}
62+
}
63+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System.Reflection;
2+
using System.Resources;
3+
using System.Runtime.CompilerServices;
4+
using System.Runtime.InteropServices;
5+
using System.Windows;
6+
7+
// General Information about an assembly is controlled through the following
8+
// set of attributes. Change these attribute values to modify the information
9+
// associated with an assembly.
10+
[assembly: AssemblyTitle("AddNewToolbarItem")]
11+
[assembly: AssemblyDescription("")]
12+
[assembly: AssemblyConfiguration("")]
13+
[assembly: AssemblyCompany("")]
14+
[assembly: AssemblyProduct("AddNewToolbarItem")]
15+
[assembly: AssemblyCopyright("Copyright © 2024")]
16+
[assembly: AssemblyTrademark("")]
17+
[assembly: AssemblyCulture("")]
18+
19+
// Setting ComVisible to false makes the types in this assembly not visible
20+
// to COM components. If you need to access a type in this assembly from
21+
// COM, set the ComVisible attribute to true on that type.
22+
[assembly: ComVisible(false)]
23+
24+
//In order to begin building localizable applications, set
25+
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
26+
//inside a <PropertyGroup>. For example, if you are using US english
27+
//in your source files, set the <UICulture> to en-US. Then uncomment
28+
//the NeutralResourceLanguage attribute below. Update the "en-US" in
29+
//the line below to match the UICulture setting in the project file.
30+
31+
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32+
33+
34+
[assembly: ThemeInfo(
35+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36+
//(used if a resource is not found in the page,
37+
// or application resource dictionaries)
38+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39+
//(used if a resource is not found in the page,
40+
// app, or any theme specific resource dictionaries)
41+
)]
42+
43+
44+
// Version information for an assembly consists of the following four values:
45+
//
46+
// Major Version
47+
// Minor Version
48+
// Build Number
49+
// Revision
50+
//
51+
// You can specify all the values or you can default the Build and Revision Numbers
52+
// by using the '*' as shown below:
53+
// [assembly: AssemblyVersion("1.0.*")]
54+
[assembly: AssemblyVersion("1.0.0.0")]
55+
[assembly: AssemblyFileVersion("1.0.0.0")]

Toolbar/AddNewToolbarItem/Properties/Resources.Designer.cs

Lines changed: 71 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)