Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e0105b0

Browse files
committedMay 14, 2025·
900674 - added sample for apply localization to WPF PdfViewer in winforms app
1 parent 7109c44 commit e0105b0

23 files changed

+2180
-0
lines changed
 
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35707.178
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalizationClassLibrary", "LocalizationClassLibrary\LocalizationClassLibrary.csproj", "{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HostedLocalizationSample", "HostedLocalizationSample\HostedLocalizationSample.csproj", "{EE530E7C-768A-4D2B-9CAB-45D6883C5E88}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{EE530E7C-768A-4D2B-9CAB-45D6883C5E88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{EE530E7C-768A-4D2B-9CAB-45D6883C5E88}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{EE530E7C-768A-4D2B-9CAB-45D6883C5E88}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{EE530E7C-768A-4D2B-9CAB-45D6883C5E88}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
EndGlobal
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.8" />
5+
</startup>
6+
</configuration>

‎How-to/Apply-localization-to-WPF-PdfViewer-hosted-in-Winforms/HostedLocalizationSample/Form1.Designer.cs

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Syncfusion.Windows.PdfViewer;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.ComponentModel;
5+
using System.Data;
6+
using System.Drawing;
7+
using System.Linq;
8+
using System.Text;
9+
using System.Threading.Tasks;
10+
using System.Windows.Forms;
11+
using System.Windows.Forms.Integration;
12+
13+
namespace HostedLocalizationSample
14+
{
15+
public partial class Form1 : Form
16+
{
17+
ElementHost elementHost = new ElementHost();
18+
WPFUserControl pdfViewer;
19+
public Form1()
20+
{
21+
InitializeComponent();
22+
pdfViewer = new WPFUserControl();
23+
elementHost.Dock = DockStyle.Fill;
24+
elementHost.Child = pdfViewer;
25+
this.Controls.Add(elementHost);
26+
this.Load += Form1_Load;
27+
}
28+
29+
private void Form1_Load(object sender, EventArgs e)
30+
{
31+
this.WindowState = FormWindowState.Maximized;
32+
}
33+
}
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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>{EE530E7C-768A-4D2B-9CAB-45D6883C5E88}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>HostedLocalizationSample</RootNamespace>
10+
<AssemblyName>HostedLocalizationSample</AssemblyName>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
<TargetFrameworkProfile />
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<PlatformTarget>AnyCPU</PlatformTarget>
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<PlatformTarget>AnyCPU</PlatformTarget>
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\Release\</OutputPath>
32+
<DefineConstants>TRACE</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Reference Include="PresentationCore" />
38+
<Reference Include="PresentationFramework" />
39+
<packageReference Include="Syncfusion.PdfViewer.WPF" version="*" />
40+
<Reference Include="System" />
41+
<Reference Include="System.Core" />
42+
<Reference Include="System.Xaml" />
43+
<Reference Include="System.Xml.Linq" />
44+
<Reference Include="System.Data.DataSetExtensions" />
45+
<Reference Include="Microsoft.CSharp" />
46+
<Reference Include="System.Data" />
47+
<Reference Include="System.Deployment" />
48+
<Reference Include="System.Drawing" />
49+
<Reference Include="System.Net.Http" />
50+
<Reference Include="System.Windows.Forms" />
51+
<Reference Include="System.Xml" />
52+
<Reference Include="WindowsBase" />
53+
<Reference Include="WindowsFormsIntegration" />
54+
</ItemGroup>
55+
<ItemGroup>
56+
<Compile Include="Form1.cs">
57+
<SubType>Form</SubType>
58+
</Compile>
59+
<Compile Include="Form1.Designer.cs">
60+
<DependentUpon>Form1.cs</DependentUpon>
61+
</Compile>
62+
<Compile Include="Program.cs" />
63+
<Compile Include="Properties\AssemblyInfo.cs" />
64+
<Compile Include="WPFUserControl.xaml.cs">
65+
<DependentUpon>WPFUserControl.xaml</DependentUpon>
66+
</Compile>
67+
<EmbeddedResource Include="Properties\Resources.resx">
68+
<Generator>ResXFileCodeGenerator</Generator>
69+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
70+
<SubType>Designer</SubType>
71+
</EmbeddedResource>
72+
<Compile Include="Properties\Resources.Designer.cs">
73+
<AutoGen>True</AutoGen>
74+
<DependentUpon>Resources.resx</DependentUpon>
75+
<DesignTime>True</DesignTime>
76+
</Compile>
77+
<None Include="packages.config" />
78+
<None Include="Properties\Settings.settings">
79+
<Generator>SettingsSingleFileGenerator</Generator>
80+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
81+
</None>
82+
<Compile Include="Properties\Settings.Designer.cs">
83+
<AutoGen>True</AutoGen>
84+
<DependentUpon>Settings.settings</DependentUpon>
85+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
86+
</Compile>
87+
</ItemGroup>
88+
<ItemGroup>
89+
<None Include="App.config" />
90+
</ItemGroup>
91+
<ItemGroup>
92+
<Page Include="WPFUserControl.xaml">
93+
<SubType>Designer</SubType>
94+
<Generator>MSBuild:Compile</Generator>
95+
</Page>
96+
</ItemGroup>
97+
<ItemGroup>
98+
<ProjectReference Include="..\LocalizationClassLibrary\LocalizationClassLibrary.csproj">
99+
<Project>{3a4f9d5f-fa2b-41d7-aeac-339ff4a540c6}</Project>
100+
<Name>LocalizationClassLibrary</Name>
101+
</ProjectReference>
102+
</ItemGroup>
103+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
104+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFramework>net8.0-windows</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
<UseWindowsForms>true</UseWindowsForms>
8+
<UseWPF>true</UseWPF>
9+
<ImplicitUsings>enable</ImplicitUsings>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Syncfusion.PdfViewer.WPF" Version="*" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\LocalizationClassLibrary\LocalizationClassLibrary.csproj" />
18+
</ItemGroup>
19+
20+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup />
4+
<ItemGroup>
5+
<Compile Update="Form1.cs">
6+
<SubType>Form</SubType>
7+
</Compile>
8+
</ItemGroup>
9+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35707.178
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HostedLocalizationSample_NET", "HostedLocalizationSample_NET.csproj", "{3DA71362-018F-4277-B90A-288E1A370CBD}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalizationClassLibrary", "..\LocalizationClassLibrary\LocalizationClassLibrary.csproj", "{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{3DA71362-018F-4277-B90A-288E1A370CBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{3DA71362-018F-4277-B90A-288E1A370CBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{3DA71362-018F-4277-B90A-288E1A370CBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{3DA71362-018F-4277-B90A-288E1A370CBD}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
EndGlobal
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using System.Windows.Forms;
6+
7+
namespace HostedLocalizationSample
8+
{
9+
internal static class Program
10+
{
11+
/// <summary>
12+
/// The main entry point for the application.
13+
/// </summary>
14+
[STAThread]
15+
static void Main()
16+
{
17+
Application.EnableVisualStyles();
18+
Application.SetCompatibleTextRenderingDefault(false);
19+
Application.Run(new Form1());
20+
}
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyCopyright("Copyright © 2025")]
10+
[assembly: AssemblyTrademark("")]
11+
[assembly: AssemblyCulture("")]
12+
13+
// Setting ComVisible to false makes the types in this assembly not visible
14+
// to COM components. If you need to access a type in this assembly from
15+
// COM, set the ComVisible attribute to true on that type.
16+
[assembly: ComVisible(false)]
17+
18+
// The following GUID is for the ID of the typelib if this project is exposed to COM
19+
[assembly: Guid("ee530e7c-768a-4d2b-9cab-45d6883c5e88")]
20+
21+
// Version information for an assembly consists of the following four values:
22+
//
23+
// Major Version
24+
// Minor Version
25+
// Build Number
26+
// Revision
27+
//

‎How-to/Apply-localization-to-WPF-PdfViewer-hosted-in-Winforms/HostedLocalizationSample/Properties/Resources.Designer.cs

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<root>
3+
<!--
4+
Microsoft ResX Schema
5+
6+
Version 2.0
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
11+
associated with the data types.
12+
13+
Example:
14+
15+
... ado.net/XML headers & schema ...
16+
<resheader name="resmimetype">text/microsoft-resx</resheader>
17+
<resheader name="version">2.0</resheader>
18+
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21+
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+
<value>[base64 mime encoded serialized .NET Framework object]</value>
24+
</data>
25+
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27+
<comment>This is a comment</comment>
28+
</data>
29+
30+
There are any number of "resheader" rows that contain simple
31+
name/value pairs.
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
37+
mimetype set.
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
41+
extensible. For a given mimetype the value must be set accordingly:
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
45+
read any of the formats listed below.
46+
47+
mimetype: application/x-microsoft.net.object.binary.base64
48+
value : The object must be serialized with
49+
: System.Serialization.Formatters.Binary.BinaryFormatter
50+
: and then encoded with base64 encoding.
51+
52+
mimetype: application/x-microsoft.net.object.soap.base64
53+
value : The object must be serialized with
54+
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55+
: and then encoded with base64 encoding.
56+
57+
mimetype: application/x-microsoft.net.object.bytearray.base64
58+
value : The object must be serialized into a byte array
59+
: using a System.ComponentModel.TypeConverter
60+
: and then encoded with base64 encoding.
61+
-->
62+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+
<xsd:element name="root" msdata:IsDataSet="true">
64+
<xsd:complexType>
65+
<xsd:choice maxOccurs="unbounded">
66+
<xsd:element name="metadata">
67+
<xsd:complexType>
68+
<xsd:sequence>
69+
<xsd:element name="value" type="xsd:string" minOccurs="0" />
70+
</xsd:sequence>
71+
<xsd:attribute name="name" type="xsd:string" />
72+
<xsd:attribute name="type" type="xsd:string" />
73+
<xsd:attribute name="mimetype" type="xsd:string" />
74+
</xsd:complexType>
75+
</xsd:element>
76+
<xsd:element name="assembly">
77+
<xsd:complexType>
78+
<xsd:attribute name="alias" type="xsd:string" />
79+
<xsd:attribute name="name" type="xsd:string" />
80+
</xsd:complexType>
81+
</xsd:element>
82+
<xsd:element name="data">
83+
<xsd:complexType>
84+
<xsd:sequence>
85+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
86+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
87+
</xsd:sequence>
88+
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
89+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
90+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
91+
</xsd:complexType>
92+
</xsd:element>
93+
<xsd:element name="resheader">
94+
<xsd:complexType>
95+
<xsd:sequence>
96+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
97+
</xsd:sequence>
98+
<xsd:attribute name="name" type="xsd:string" use="required" />
99+
</xsd:complexType>
100+
</xsd:element>
101+
</xsd:choice>
102+
</xsd:complexType>
103+
</xsd:element>
104+
</xsd:schema>
105+
<resheader name="resmimetype">
106+
<value>text/microsoft-resx</value>
107+
</resheader>
108+
<resheader name="version">
109+
<value>2.0</value>
110+
</resheader>
111+
<resheader name="reader">
112+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
113+
</resheader>
114+
<resheader name="writer">
115+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116+
</resheader>
117+
</root>

‎How-to/Apply-localization-to-WPF-PdfViewer-hosted-in-Winforms/HostedLocalizationSample/Properties/Settings.Designer.cs

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
3+
<Profiles>
4+
<Profile Name="(Default)" />
5+
</Profiles>
6+
<Settings />
7+
</SettingsFile>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<UserControl x:Class="HostedLocalizationSample.WPFUserControl"
2+
xmlns:PdfViewer="clr-namespace:Syncfusion.Windows.PdfViewer;assembly=Syncfusion.PdfViewer.WPF"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:local="clr-namespace:HostedLocalizationSample"
8+
mc:Ignorable="d"
9+
d:DesignHeight="450" d:DesignWidth="800" >
10+
<Grid>
11+
<PdfViewer:PdfViewerControl x:Name="pdfViewer"/>
12+
</Grid>
13+
</UserControl>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using Syncfusion.Windows.PdfViewer;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Diagnostics;
5+
using System.Globalization;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Threading;
9+
using System.Threading.Tasks;
10+
using System.Windows;
11+
using System.Windows.Controls;
12+
using System.Windows.Data;
13+
using System.Windows.Documents;
14+
using System.Windows.Input;
15+
using System.Windows.Media;
16+
using System.Windows.Media.Imaging;
17+
using System.Windows.Navigation;
18+
using System.Windows.Shapes;
19+
using UserControl = System.Windows.Controls.UserControl;
20+
21+
namespace HostedLocalizationSample
22+
{
23+
/// <summary>
24+
/// Interaction logic for WPFUserControl.xaml
25+
/// </summary>
26+
public partial class WPFUserControl : UserControl
27+
{
28+
string path;
29+
public WPFUserControl()
30+
{
31+
InitializeComponent();
32+
//set the current culture to the en
33+
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
34+
//Set the custom class library assmebly and and namespace for the localization
35+
LocalizationManager.SetResources(
36+
typeof(LocalizationClassLibrary.Class1).Assembly,
37+
"LocalizationClassLibrary"
38+
);
39+
#if NETCOREAPP
40+
path = "../../../Data/F#.pdf";
41+
#else
42+
path = "../../Data/F#.pdf";
43+
#endif
44+
//Load the pdf
45+
pdfViewer.Load(path);
46+
47+
}
48+
}
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Syncfusion.Compression.Base" version="29.1.41" targetFramework="net48" />
4+
<package id="Syncfusion.Licensing" version="29.1.41" targetFramework="net48" />
5+
<package id="Syncfusion.Pdf.Wpf" version="29.1.41" targetFramework="net48" />
6+
<package id="Syncfusion.PdfToImageConverter.WPF" version="29.1.41" targetFramework="net48" />
7+
<package id="Syncfusion.PdfViewer.WPF" version="29.1.41" targetFramework="net48" />
8+
<package id="Syncfusion.Shared.WPF" version="29.1.41" targetFramework="net48" />
9+
</packages>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace LocalizationClassLibrary
8+
{
9+
public class Class1
10+
{
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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>{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>LocalizationClassLibrary</RootNamespace>
11+
<AssemblyName>LocalizationClassLibrary</AssemblyName>
12+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="System" />
35+
<Reference Include="System.Core" />
36+
<Reference Include="System.Xml.Linq" />
37+
<Reference Include="System.Data.DataSetExtensions" />
38+
<Reference Include="Microsoft.CSharp" />
39+
<Reference Include="System.Data" />
40+
<Reference Include="System.Net.Http" />
41+
<Reference Include="System.Xml" />
42+
</ItemGroup>
43+
<ItemGroup>
44+
<Compile Include="Class1.cs" />
45+
<Compile Include="Properties\AssemblyInfo.cs" />
46+
</ItemGroup>
47+
<ItemGroup />
48+
<ItemGroup>
49+
<EmbeddedResource Include="Resources\Syncfusion.PdfViewer.WPF.en.resx">
50+
<SubType>Designer</SubType>
51+
</EmbeddedResource>
52+
<EmbeddedResource Include="Resources\Syncfusion.PdfViewer.WPF.resx">
53+
<SubType>Designer</SubType>
54+
</EmbeddedResource>
55+
</ItemGroup>
56+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
57+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("LocalizationClassLibrary")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("LocalizationClassLibrary")]
13+
[assembly: AssemblyCopyright("Copyright © 2025")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("3a4f9d5f-fa2b-41d7-aeac-339ff4a540c6")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
[assembly: AssemblyVersion("1.0.0.0")]
33+
[assembly: AssemblyFileVersion("1.0.0.0")]

‎How-to/Apply-localization-to-WPF-PdfViewer-hosted-in-Winforms/LocalizationClassLibrary/Resources/Syncfusion.PdfViewer.WPF.en.resx

Lines changed: 738 additions & 0 deletions
Large diffs are not rendered by default.

‎How-to/Apply-localization-to-WPF-PdfViewer-hosted-in-Winforms/LocalizationClassLibrary/Resources/Syncfusion.PdfViewer.WPF.resx

Lines changed: 738 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.