Skip to content

947956 : Custom Toolbar Zoom Percentage is not working properly #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
28 changes: 28 additions & 0 deletions Toolbar/CustomToolbar/CustomToolbar.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomToolbar", "CustomToolbar\CustomToolbar.csproj", "{6AC69A74-7539-4C2C-BDFD-F436674A7FBD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Release-Xml|Any CPU = Release-Xml|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6AC69A74-7539-4C2C-BDFD-F436674A7FBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AC69A74-7539-4C2C-BDFD-F436674A7FBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AC69A74-7539-4C2C-BDFD-F436674A7FBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AC69A74-7539-4C2C-BDFD-F436674A7FBD}.Release|Any CPU.Build.0 = Release|Any CPU
{6AC69A74-7539-4C2C-BDFD-F436674A7FBD}.Release-Xml|Any CPU.ActiveCfg = Release|Any CPU
{6AC69A74-7539-4C2C-BDFD-F436674A7FBD}.Release-Xml|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7DED6731-AC5D-4C1B-8058-DCD4D383B3E3}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions Toolbar/CustomToolbar/CustomToolbar/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
</startup>
</configuration>
9 changes: 9 additions & 0 deletions Toolbar/CustomToolbar/CustomToolbar/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="CustomToolBar.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CustomToolBar"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions Toolbar/CustomToolbar/CustomToolbar/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace CustomToolBar
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
169 changes: 169 additions & 0 deletions Toolbar/CustomToolbar/CustomToolbar/CustomToolbar.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6AC69A74-7539-4C2C-BDFD-F436674A7FBD}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>CustomToolbar</RootNamespace>
<AssemblyName>CustomToolbar</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the project file for .NET Core?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core projects also created na

<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Syncfusion.Compression.Base">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Assemblies\Syncfusion.Compression.Base.dll</HintPath>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the reference on given as paths?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you said i removed the reference path

</Reference>
<Reference Include="Syncfusion.Licensing">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Assemblies\Syncfusion.Licensing.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Pdf.Base">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Assemblies\Syncfusion.Pdf.Base.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.PdfViewer.WPF">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Assemblies\Syncfusion.PdfViewer.WPF.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.SfSkinManager.WPF">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Assemblies\Syncfusion.SfSkinManager.WPF.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Shared.Wpf">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Assemblies\Syncfusion.Shared.Wpf.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Themes.Office2019Colorful.WPF">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Assemblies\Syncfusion.Themes.Office2019Colorful.WPF.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Tools.WPF">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Assemblies\Syncfusion.Tools.WPF.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Controls.Ribbon" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="ViewModel\ViewModel.cs" />
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Helper\PdfViewerEventAttachUtil.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icon\Data-Find.png" />
<Resource Include="Icon\Fit-To-Size.png" />
<Resource Include="Icon\Folder-Open-01.png" />
<Resource Include="Icon\Folder-Open.png" />
<Resource Include="Icon\Icons_Backward.png" />
<Resource Include="Icon\Icons_FitPage.png" />
<Resource Include="Icon\Icons_FitWidth.png" />
<Resource Include="Icon\Icons_Forward.png" />
<Resource Include="Icon\Icons_Front.png" />
<Resource Include="Icon\Icons_Last.png" />
<Resource Include="Icon\Icons_Open.png" />
<Resource Include="Icon\Icons_Print.png" />
<Resource Include="Icon\Icons_Save.png" />
<Resource Include="Icon\Icons_Search.png" />
<Resource Include="Icon\Icons_Stamp.png" />
<Resource Include="Icon\Icons_Zoom In.png" />
<Resource Include="Icon\Icons_Zoom Out.png" />
<Resource Include="Icon\Media Fast-forward.png" />
<Resource Include="Icon\Media Next.png" />
<Resource Include="Icon\Media Previous.png" />
<Resource Include="Icon\Media Rewind.png" />
<Resource Include="Icon\Open32.png" />
<Resource Include="Icon\OpenFile.png" />
<Resource Include="Icon\openHS.png" />
<Resource Include="Icon\PrintArea.png" />
<Resource Include="Icon\Printer New.png" />
<Resource Include="Icon\PrintHS.png" />
<Resource Include="Icon\Save As.png" />
<Resource Include="Icon\SaveAs32.png" />
<Resource Include="Icon\saveHS.png" />
<Resource Include="Icon\Scale-To-Fit.png" />
<Resource Include="Icon\Zoom-In.png" />
<Resource Include="Icon\Zoom-Out.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
6 changes: 6 additions & 0 deletions Toolbar/CustomToolbar/CustomToolbar/CustomToolbar.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this .User file. Ith should not be commited

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you said I removed the user file

<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
24 changes: 24 additions & 0 deletions Toolbar/CustomToolbar/CustomToolbar/CustomToolbar.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.2.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomToolbar", "CustomToolbar.csproj", "{BDB4645E-EC1F-6D00-4FE7-2C6AB5166375}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why there is 2 solution file for a single project?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you said delete the duplicate solution na

EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BDB4645E-EC1F-6D00-4FE7-2C6AB5166375}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BDB4645E-EC1F-6D00-4FE7-2C6AB5166375}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BDB4645E-EC1F-6D00-4FE7-2C6AB5166375}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BDB4645E-EC1F-6D00-4FE7-2C6AB5166375}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E4AE6383-1A5C-46C2-93BE-A60C75360BC0}
EndGlobalSection
EndGlobal
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#region Copyright Syncfusion Inc. 2001-2021.
// Copyright Syncfusion Inc. 2001-2021. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// [email protected]. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using System.Windows;
using System.Windows.Controls;

namespace syncfusion.pdfviewerdemos.wpf
{
public class PdfViewerEventAttachUtil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we have added this file here? what is the usage

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this class they handled the custom toolbar view model loaded and closed event

{
public static DependencyProperty WindowLoaded = DependencyProperty.RegisterAttached("WindowLoaded", typeof(bool), typeof(PdfViewerEventAttachUtil), new PropertyMetadata(new PropertyChangedCallback(WindowLoadedChanged)));

public static void SetWindowLoaded(DependencyObject sender, bool command)
{
sender.SetValue(WindowLoaded, command);
}

public static void WindowLoadedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
{
Grid grid = sender as Grid;
if (grid != null)
{
Window view = grid.Parent as Window;
if (view != null)
{

if (view.ToString().Contains("CustomToolBar"))
{
CustomToolbarViewModel viewModel = view.DataContext as CustomToolbarViewModel;
if (viewModel != null)
{
view.Loaded += new RoutedEventHandler(viewModel.Loaded);
view.Closed += new EventHandler(viewModel.Closed);
}
}
}
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The below image file have many duplicates. Remove the unused images

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you said i checked and removed the unused images

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Toolbar/CustomToolbar/CustomToolbar/Icon/PrintHS.png
Binary file added Toolbar/CustomToolbar/CustomToolbar/Icon/Save As.png
Binary file added Toolbar/CustomToolbar/CustomToolbar/Icon/openHS.png
Binary file added Toolbar/CustomToolbar/CustomToolbar/Icon/saveHS.png
Loading