【问题标题】:Editing the style of xctk:DoubleUpDown Control编辑 xctk:DoubleUpDown 控件的样式
【发布时间】:2015-08-12 11:58:43
【问题描述】:

我喜欢将 xctk:DoubleUpDown 控件的角半径更改为 2。 以下代码不起作用。 如果没有控制模板部分,则不会显示错误,但使用“Setter 属性模板部分”会显示错误“73 Undefined CLR-namespace´ URI to a namespace ´Xceed.Wpf.Toolkit.Themes that 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>

【问题讨论】:

    标签: wpf xaml wpf-controls wpf-style wpf-extended-toolkit


    【解决方案1】:

    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-22
      相关资源
      最近更新 更多