Styling of PdfAnnotationWindow
Hi,
I have some global styles in App.xaml for TextBox, but these have an influence on TextBoxes in PdfAnnotationWindow - e.g. in Oval properties window. Causing TextBoxes being cut-off. Since PdfAnnotationWindow is private a can't change the style in there.
Would be nice to have this class public to be able to style it properly. Or is there any other way I'm missing?
Thanks
SIGN IN To post a reply.
19 Replies
1 reply marked as answer
DD
Divya Dhayalan
Syncfusion Team
January 21, 2021 10:42 AM UTC
Hi Ondrej,
Thanks for contacting Syncfusion support.
When applying a global style with the TargetType of TextBox, it affects all the TextBox used in the application. So that the issue occurred in your application. To set style for a specific TextBox, you may need to define a style key and use the key only to the specific control. Please refer to the below code changes.
App.xaml
|
<Style x:Key="OvalTextBoxStyle" TargetType="{x:Type TextBox}"> </Style> |
MainWindow.xaml
|
<TextBox Text="TextBoxUsingGlobalStyle" Style="{StaticResource OvalTextBoxStyle}"/> |
We also created a sample for the same and it can be downloaded from the below link,
Please let us know if the provided solution helps.
Regards,
Divya
OS
Ondrej Svoboda
January 21, 2021 12:18 PM UTC
Hi,

Attachment: PdfViewerWPF_a39a67c4.zip
I know how to use styles, you probably didn't understand my problem.
Please see attached sample. Draw circle annotation to the pdf, right click on it and choose properties. You will see following dialog with opacity textbox cut off:
It is caused by global textbox style defined in App.xaml, which I can't change. I think I could override it by something like this:
<Style TargetType="PdfAnnotationWindow" BasedOn="{StaticResource {x:Type PdfAnnotationWindow}}">
<Style.Resources>
<Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="Margin" Value="0"/>
</Style>
</Style.Resources>
</Style>
But I'm not able to do this because PdfAnnotationWindow is not public.
I hope it is understandable now.
Attachment: PdfViewerWPF_a39a67c4.zip
DD
Divya Dhayalan
Syncfusion Team
January 22, 2021 05:19 PM UTC
Hi Ondrej,
Sorry for the inconvenience.
We can reproduce the reported behavior with the provided information. Currently we are checking on this, we will update further details on 27th January 2021.
Regards,
Divya
DD
Divya Dhayalan
Syncfusion Team
January 27, 2021 06:02 PM UTC
Hi Ondrej,
Thanks for your patience.
We have confirmed that the issue “Applying style globally for TextBox affect the textboxes in the Properties window” is a defect and we have logged a defect report for this. The patch for this fix is expected to be available on February 10th, 2021.
Please find the feedback link below,
Regards,
Divya
DD
Divya Dhayalan
Syncfusion Team
February 10, 2021 05:04 PM UTC
The issue “Applying style globally for TextBox affect the textboxes in the Properties window” has been fixed and patch for this fix can be downloaded from the following location.
Recommended approach - exe will perform automatic configuration
Please find the patch setup from below location: https://syncfusion.com/Installs/support/patch/18.4.0.30/967282/F161706/SyncfusionPatch_18.4.0.30_967282_2102021110418920_F161706.exe
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment
Please find the patch assemblies alone from below location: https://syncfusion.com/Installs/support/patch/18.4.0.30/967282/F161706/SyncfusionPatch_18.4.0.30_967282_2102021110418920_F161706.zip
Assembly Version: 18.4.0.30
Installation Directions:
This patch should replace the files “Syncfusion.Pdf.Base.dll, Syncfusion.PdfViewer.WPF.dll” under the following folder.
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.6
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\9.3.0.61\precompiledassemblies\9.3.0.61\4.0
To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.
Note:
You can change how you receive bug fixes by navigating to the following link and updating your preferences.
Disclaimer:
Please note that we have created this patch for the version 18.4.0.30 specifically to resolve the following issue reported in this Forum. 161706
If you have received other patches for the same version for other products, please apply all patches in the order received.
This fix will be included in our 2021 Volume 1 release which will be available on March month – 2021
Please find the feedback link below,
Regards,
Divya
Marked as answer
OS
Ondrej Svoboda
February 11, 2021 09:30 AM UTC
Hi,
thank you. Will it be also included in your weekly nuget release next week?
DD
Divya Dhayalan
Syncfusion Team
February 12, 2021 06:38 AM UTC
Hi Ondrej,
We will include the fix for this issue in our upcoming weekly NuGet release, which is expected to be available on 16th February 2021.
Regards,
Divya
DD
Divya Dhayalan
Syncfusion Team
February 16, 2021 05:52 AM UTC
Thanks for your patience.
We have included the fix for this issue in our latest weekly NuGet release (v18.4.0.43), please find the NuGet package link below,
Regards,
Divya
OS
Ondrej Svoboda
February 25, 2021 03:03 PM UTC
Hi,
now I see the margin issue is gone by setting local margin value to 0. But still it is not ideal in my case. I have little bit more complicated TextBox template (I use MaterialDesignXamlToolkit - https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TextBox.xaml). You have on all the controls in this window local height value 20, but my TextBoxes (and also ComboBoxes) needs to be higher so now its still not displayed properly. Would it be possible to remove the local height value and set it to auto?
DD
Divya Dhayalan
Syncfusion Team
February 28, 2021 06:25 PM UTC
Hi Ondrej,
Thanks for contacting Syncfusion support.
We are currently checking on this and will update further details on 2nd March 2021.
Regards,
Divya
VS
Vikas Sekar
Syncfusion Team
March 2, 2021 10:50 PM UTC
Hi Ondrej,
We are checking the possibilities to achieve your requirement with high priority, we will update further as early as possible.
Regards,
Vikas
DD
Divya Dhayalan
Syncfusion Team
March 9, 2021 02:08 AM UTC
Hi Ondrej,
Thank you for your patience.
We have used the static value for textbox height to maintain the alignment of PdfAnnotationWindow. When we analyzed further by setting the height of the text boxes as auto, which exposed the following behaviours,
1. The minimum and maximum height requirement of us is not considered.
2. The textbox height will get extended only up to the allocated size within their parent control
Due to the above behaviors, we may require setting minimum and maximum height for the textbox to maintain our side of alignment. And also, setting auto as height is not considering the height value which is the maximum of the allocated size in their parent control size.
Kindly let us know if we provide a solution by considering the minimum and maximum height for textboxes with auto will be helpful to achieve your requirement with the maximum height restriction. This information will be more helpful for us to proceed further on this.
Regards,
Divya
OS
Ondrej Svoboda
March 9, 2021 09:36 AM UTC
Hi,
I'm not sure if I understand you right. Do you plan to change textbox height to Auto and set some MinHeight and MaxHeight values instead?
If yes then it might work for me depending on what MaxHeight value will be used. Can't you do it without MaxHeight limit?
DD
Divya Dhayalan
Syncfusion Team
March 10, 2021 09:40 PM UTC
Hi Ondrej,
Sorry for the inconvenience caused.
On analyzed further, we found that when we set auto or minimum value for height of the textbox fields which are in PdfAnnotationWindow, which affects the alignment of the PdfViewer style since those field get extended up to the allocated size within their parent control. This affects the alignment of our PdfAnnotationWindow so, we cannot set the height as auto.
Please share the purpose of yours for which you have requested to set the textbox field height as auto, which will be helpful for us to proceed further on this and provide you a better solution.
Note: we could not set maximum height for textbox fields, since the textbox height will get extended only up to the allocated size within their parent control.
Regards,
Divya
OS
Ondrej Svoboda
March 15, 2021 02:33 PM UTC
Hi,


Attachment: PDFViewer_b5fa1349.zip
in my app I use this material design theme: Material Design In XAML Toolkit (https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit) and it has TextBoxes higher than 20. Because of that local height value I have cut-off TextBoxes in all your properties windows. Please check attached sample.
Thanks for helping!
Attachment: PDFViewer_b5fa1349.zip
DD
Divya Dhayalan
Syncfusion Team
March 16, 2021 07:07 PM UTC
Hi Ondrej,
Thank you providing more information.
We are currently checking this with MaterialXamlToolKit design theme. We will update further details on 18th March 2021.
Regards,
Divya
DD
Divya Dhayalan
Syncfusion Team
March 18, 2021 11:50 PM UTC
Hi Ondrej,
We can reproduce the reported behavior with the provided application. Modifying the PdfAnnotationWindow textbox properties involves much complexity and an uncertain of alignment issue. From your update, we suspect that you are using Material Xaml toolkit to apply theme changes to the entire control. So, we suggest the Syncfusion Themes support, for which we have already configured our PdfViewerControl to work. Currently we are supporting Material, Office 2019, Office 2016 cluster themes and some more themes will be added in our upcoming releases.
Please refer the following link to know more detail about theme studio and to create customized theme,
We have also created a sample for your reference, which can be downloaded from the below link,
In the above sample, the MaterialDarkBlue, Material Light, MaterialDark, MaterialLightBlue themes applied to the entire control when we click corresponding buttons.
Please let us know if your requirement can be achieved with the above details or if you need any further assistance on this.
Regards,
Divya
OS
Ondrej Svoboda
March 19, 2021 10:38 AM UTC
Hi,
thank you for the tip about your themes. I've successfully implemented this solution and it works correctly in combination with MaterialXamlToolKit. This is an acceptable solution for me.
Thank you!
DD
Divya Dhayalan
Syncfusion Team
March 22, 2021 08:51 AM UTC
Hi Ondrej,
Most Welcome.
Regards,
Divya
SIGN IN To post a reply.
- 19 Replies
- 3 Participants
- Marked answer
-
OS Ondrej Svoboda
- Jan 20, 2021 04:10 PM UTC
- Mar 22, 2021 08:51 AM UTC