0

我喜欢将 xctk:DoubleUpDown 控件的角半径更改为 2。以下代码不起作用。如果没有控制模板部分,则不会显示错误,但使用“Setter Property Template 部分”会显示错误“73 Undefined CLR-namespace´ URI to a namespace ´Xceed.Wpf.Toolkit.Themesthat could not be found”。被展示。

Fontfamily、Fontsize、BorderThickness、Foreground 正在工作。

感谢您的任何帮助。

<xCtrl:ToolPanel 
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         xmlns:xCtrl="clr-namespace:XRayOfficeCore.GUI.Wpf;assembly=XRayOfficeCore"
         xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" x:Class="EmitterGUI.StandardGUIPanel"
        xmlns:theme="clr-namespace:Xceed.Wpf.Toolkit.Themes;assembly=Xceed.Wpf.Toolkit"    
         mc:Ignorable="d" Width="564" Height="362">

    <xCtrl:ToolPanel.Resources>

   <Style TargetType="xctk:DoubleUpDown">
                <Setter Property="BorderBrush" Value="#FFC7CACC"/>
        <Setter Property="FontFamily" Value="Frutiger LT Com 45 Light"/>
        <Setter Property="FontSize" Value="13"/>
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Background" Value="#FFFFFFFF"/>
        <Setter Property="Foreground" Value="#FF000000" />
        <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type xctk:DoubleUpDown}">
            <Border BorderThickness="1" CornerRadius="2">
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

 </xCtrl:ToolPanel.Resources>
<Grid> 
(...)
</Grid>
</xCtrl:ToolPanel>
4

1 回答 1

0

xctk:DoubleUpDown 继承自 UpDownBase (不直接),预计以下 pars 将在控件模板中

请参阅基类 TemplatePart 属性:

 [TemplatePart(Name = "PART_Spinner", Type = typeof (Spinner))]
 [TemplatePart(Name = "PART_TextBox", Type = typeof (TextBox))]
 public abstract class UpDownBase<T> : InputBase, IValidateInput
于 2015-11-11T17:18:26.107 回答