Skip to content

Commit 6b75a46

Browse files
authored
Merge pull request #50 from SyncfusionExamples/947956
947956 : Custom Toolbar Zoom Percentage is not working properly
2 parents 85b6f57 + 0fe3cbd commit 6b75a46

18 files changed

+1796
-0
lines changed

Toolbar/CustomToolbar/App.config

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

Toolbar/CustomToolbar/App.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="CustomToolBar.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:CustomToolBar"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>

Toolbar/CustomToolbar/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 CustomToolBar
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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>{6AC69A74-7539-4C2C-BDFD-F436674A7FBD}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>CustomToolbar</RootNamespace>
10+
<AssemblyName>CustomToolbar</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<WarningLevel>4</WarningLevel>
15+
<Deterministic>true</Deterministic>
16+
<TargetFrameworkProfile />
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<PlatformTarget>AnyCPU</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE;FRAMEWORK</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
<Prefer32Bit>false</Prefer32Bit>
28+
</PropertyGroup>
29+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
30+
<PlatformTarget>AnyCPU</PlatformTarget>
31+
<DebugType>pdbonly</DebugType>
32+
<Optimize>true</Optimize>
33+
<OutputPath>bin\Release\</OutputPath>
34+
<DefineConstants>TRACE;FRAMEWORK</DefineConstants>
35+
<ErrorReport>prompt</ErrorReport>
36+
<WarningLevel>4</WarningLevel>
37+
</PropertyGroup>
38+
<ItemGroup>
39+
<PackageReference Include="Syncfusion.PdfViewer.WPF" Version="*" />
40+
<PackageReference Include="Syncfusion.SfSkinManager.WPF" Version="*"/>
41+
<PackageReference Include="Syncfusion.Themes.Office2019Colorful.WPF" Version="*"/>
42+
<PackageReference Include="Syncfusion.Tools.WPF" Version="*"/>
43+
<Reference Include="System" />
44+
<Reference Include="System.Data" />
45+
<Reference Include="System.Windows.Controls.Ribbon" />
46+
<Reference Include="System.Xml" />
47+
<Reference Include="Microsoft.CSharp" />
48+
<Reference Include="System.Core" />
49+
<Reference Include="System.Xml.Linq" />
50+
<Reference Include="System.Data.DataSetExtensions" />
51+
<Reference Include="System.Net.Http" />
52+
<Reference Include="System.Xaml">
53+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
54+
</Reference>
55+
<Reference Include="WindowsBase" />
56+
<Reference Include="PresentationCore" />
57+
<Reference Include="PresentationFramework" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<ApplicationDefinition Include="App.xaml">
61+
<Generator>MSBuild:Compile</Generator>
62+
<SubType>Designer</SubType>
63+
</ApplicationDefinition>
64+
<Compile Include="ViewModel\ViewModel.cs" />
65+
<Page Include="MainWindow.xaml">
66+
<Generator>MSBuild:Compile</Generator>
67+
<SubType>Designer</SubType>
68+
</Page>
69+
<Compile Include="App.xaml.cs">
70+
<DependentUpon>App.xaml</DependentUpon>
71+
<SubType>Code</SubType>
72+
</Compile>
73+
<Compile Include="Helper\PdfViewerEventAttachUtil.cs" />
74+
<Compile Include="MainWindow.xaml.cs">
75+
<DependentUpon>MainWindow.xaml</DependentUpon>
76+
<SubType>Code</SubType>
77+
</Compile>
78+
</ItemGroup>
79+
<ItemGroup>
80+
<Compile Include="Properties\AssemblyInfo.cs">
81+
<SubType>Code</SubType>
82+
</Compile>
83+
<Compile Include="Properties\Resources.Designer.cs">
84+
<AutoGen>True</AutoGen>
85+
<DesignTime>True</DesignTime>
86+
<DependentUpon>Resources.resx</DependentUpon>
87+
</Compile>
88+
<Compile Include="Properties\Settings.Designer.cs">
89+
<AutoGen>True</AutoGen>
90+
<DependentUpon>Settings.settings</DependentUpon>
91+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
92+
</Compile>
93+
<EmbeddedResource Include="Properties\Resources.resx">
94+
<Generator>ResXFileCodeGenerator</Generator>
95+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
96+
</EmbeddedResource>
97+
<None Include="Data\F# Succinctly.pdf" />
98+
<None Include="Properties\Settings.settings">
99+
<Generator>SettingsSingleFileGenerator</Generator>
100+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
101+
</None>
102+
</ItemGroup>
103+
<ItemGroup>
104+
<None Include="App.config" />
105+
</ItemGroup>
106+
<ItemGroup>
107+
<Resource Include="Data\PdfViewer\Approved.png" />
108+
</ItemGroup>
109+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
110+
</Project>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.5.2.0
4+
MinimumVisualStudioVersion = 10.0.40219.1
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomToolbar", "CustomToolbar.csproj", "{BDB4645E-EC1F-6D00-4FE7-2C6AB5166375}"
6+
EndProject
7+
Global
8+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9+
Debug|Any CPU = Debug|Any CPU
10+
Release|Any CPU = Release|Any CPU
11+
EndGlobalSection
12+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
13+
{BDB4645E-EC1F-6D00-4FE7-2C6AB5166375}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
14+
{BDB4645E-EC1F-6D00-4FE7-2C6AB5166375}.Debug|Any CPU.Build.0 = Debug|Any CPU
15+
{BDB4645E-EC1F-6D00-4FE7-2C6AB5166375}.Release|Any CPU.ActiveCfg = Release|Any CPU
16+
{BDB4645E-EC1F-6D00-4FE7-2C6AB5166375}.Release|Any CPU.Build.0 = Release|Any CPU
17+
EndGlobalSection
18+
GlobalSection(SolutionProperties) = preSolution
19+
HideSolutionNode = FALSE
20+
EndGlobalSection
21+
GlobalSection(ExtensibilityGlobals) = postSolution
22+
SolutionGuid = {E4AE6383-1A5C-46C2-93BE-A60C75360BC0}
23+
EndGlobalSection
24+
EndGlobal
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
<PropertyGroup>
3+
<OutputType>WinExe</OutputType>
4+
<TargetFramework>net8.0-windows</TargetFramework>
5+
<UseWPF>true</UseWPF>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Syncfusion.PdfViewer.WPF" Version="*" />
10+
<PackageReference Include="Syncfusion.SfSkinManager.WPF" Version="*" />
11+
<PackageReference Include="Syncfusion.Themes.Office2019Colorful.WPF" Version="*" />
12+
<PackageReference Include="Syncfusion.Tools.WPF" Version="*" />
13+
</ItemGroup>
14+
</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.8.226.21692
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomToolbar_NET", "CustomToolbar_NET.csproj", "{A9693914-16B8-4605-BAF9-69C6FFE4ABB0}"
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+
{A9693914-16B8-4605-BAF9-69C6FFE4ABB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{A9693914-16B8-4605-BAF9-69C6FFE4ABB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{A9693914-16B8-4605-BAF9-69C6FFE4ABB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{A9693914-16B8-4605-BAF9-69C6FFE4ABB0}.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 = {CBF28B5B-1546-4921-BF24-226CA1F9ED89}
24+
EndGlobalSection
25+
EndGlobal
205 KB
Binary file not shown.
Loading
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#region Copyright Syncfusion Inc. 2001-2021.
2+
// Copyright Syncfusion Inc. 2001-2021. All rights reserved.
3+
// Use of this code is subject to the terms of our license.
4+
// A copy of the current license can be obtained at any time by e-mailing
5+
// [email protected]. Any infringement will be prosecuted under
6+
// applicable laws.
7+
#endregion
8+
using System;
9+
using System.Windows;
10+
using System.Windows.Controls;
11+
12+
namespace syncfusion.pdfviewerdemos.wpf
13+
{
14+
public class PdfViewerEventAttachUtil
15+
{
16+
public static DependencyProperty WindowLoaded = DependencyProperty.RegisterAttached("WindowLoaded", typeof(bool), typeof(PdfViewerEventAttachUtil), new PropertyMetadata(new PropertyChangedCallback(WindowLoadedChanged)));
17+
18+
public static void SetWindowLoaded(DependencyObject sender, bool command)
19+
{
20+
sender.SetValue(WindowLoaded, command);
21+
}
22+
/// <summary>
23+
/// Retrieves the parent Window from the given Grid and assigns handlers from the ViewModel.
24+
/// </summary>
25+
public static void WindowLoadedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
26+
{
27+
Grid grid = sender as Grid;
28+
if (grid != null)
29+
{
30+
Window view = grid.Parent as Window;
31+
if (view != null)
32+
{
33+
CustomToolbarViewModel viewModel = view.DataContext as CustomToolbarViewModel;
34+
if (viewModel != null)
35+
{
36+
view.Loaded += new RoutedEventHandler(viewModel.Loaded);
37+
view.Closed += new EventHandler(viewModel.Closed);
38+
}
39+
}
40+
}
41+
}
42+
}
43+
}

0 commit comments

Comments
 (0)