我有一个Windows 10 UWP自定义控件,它被部署为扩展SDK 控件的generic.xaml如下所示:
<Style TargetType="local:PdfDocumentView" >
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:PdfDocumentView">
<ScrollViewer x:Name="PdfScroller" HorizontalScrollBarVisibility="Auto" HorizontalScrollMode="Auto" VerticalScrollBarVisibility="Auto" VerticalScrollMode="Auto"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<local:PdfCoreView x:Name="PdfPageView" Background="{TemplateBinding Background}" />
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
扩展SDK的布局如下所示:
REDIST \ CommonConfiguration \中性\主题\ generic.xaml
REDIST \ CommonConfiguration \中性\ Xfinium.Pdf.View.Uwp.pri
参考\ CommonConfiguration \中性\ xfinium.pdf.uwp.dll
参考\ CommonConfiguration \中性\ xfinium.pdf.render.uwp.dll
引用\ CommonConfiguration \中性\ xfinium.pdf.view.uwp.dll
没有特定于体系结构的文件夹,因为控件是使用AnyCPU选项编译的纯.NET 在设计时,我从页面上的工具箱中拖动PdfDocumentView控件,并设置Background,BorderBrush和BorderThickness属性。
如果活动平台设置为x86,则根据上述3个属性在设计器中更新控件外观。如果活动平台更改为x64或ARM,则控件将变为透明,就像没有设置上述属性一样。
在运行时,控件显示正常,无论平台,x86还是x64,都会考虑所有3个属性。
VS设计师和x64平台可能出现什么问题?
答案 0 :(得分:0)
AFAIK这是一个设计师的问题,除了x86之外,对任何平台都没有用。你必须忍受它。
然而,他们正在开发一个新的,速度更快的设计师,支持更多功能,升级甚至可以解决此问题。请在this blog post中了解详情。