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 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
7 changes: 7 additions & 0 deletions Toolbar/CustomToolbar/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?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/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/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
{
}
}
110 changes: 110 additions & 0 deletions Toolbar/CustomToolbar/CustomToolbar.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?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>
<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;FRAMEWORK</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;FRAMEWORK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Syncfusion.PdfViewer.WPF" Version="*" />
<PackageReference Include="Syncfusion.SfSkinManager.WPF" Version="*"/>
<PackageReference Include="Syncfusion.Themes.Office2019Colorful.WPF" Version="*"/>
<PackageReference Include="Syncfusion.Tools.WPF" Version="*"/>
<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="Data\F# Succinctly.pdf" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="Data\PdfViewer\Approved.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
24 changes: 24 additions & 0 deletions Toolbar/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}"
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
14 changes: 14 additions & 0 deletions Toolbar/CustomToolbar/CustomToolbar_NET.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.PdfViewer.WPF" Version="*" />
<PackageReference Include="Syncfusion.SfSkinManager.WPF" Version="*" />
<PackageReference Include="Syncfusion.Themes.Office2019Colorful.WPF" Version="*" />
<PackageReference Include="Syncfusion.Tools.WPF" Version="*" />
</ItemGroup>
</Project>
25 changes: 25 additions & 0 deletions Toolbar/CustomToolbar/CustomToolbar_NET.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.226.21692
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomToolbar_NET", "CustomToolbar_NET.csproj", "{A9693914-16B8-4605-BAF9-69C6FFE4ABB0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A9693914-16B8-4605-BAF9-69C6FFE4ABB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9693914-16B8-4605-BAF9-69C6FFE4ABB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9693914-16B8-4605-BAF9-69C6FFE4ABB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9693914-16B8-4605-BAF9-69C6FFE4ABB0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CBF28B5B-1546-4921-BF24-226CA1F9ED89}
EndGlobalSection
EndGlobal
Binary file added Toolbar/CustomToolbar/Data/F# Succinctly.pdf
Binary file not shown.
Binary file added Toolbar/CustomToolbar/Data/PdfViewer/Approved.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions Toolbar/CustomToolbar/Helper/PdfViewerEventAttachUtil.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#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
{
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);
}
/// <summary>
/// Retrieves the parent Window from the given Grid and assigns handlers from the ViewModel.
/// </summary>
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)
{
CustomToolbarViewModel viewModel = view.DataContext as CustomToolbarViewModel;
if (viewModel != null)
{
view.Loaded += new RoutedEventHandler(viewModel.Loaded);
view.Closed += new EventHandler(viewModel.Closed);
}
}
}
}
}
}
Loading