在Expression Blend 4中编辑buttonspinner(扩展WPF工具包)的问题

时间:2012-06-21 11:10:26

标签: wpf expression-blend-4

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
x:Class="MPS.Window1"
x:Name="Window"
Title="Window1"
Width="640" Height="480">
<Window.Resources>
    <ControlTemplate x:Key="bs" TargetType="{x:Type xctk:ButtonSpinner}">
        <Grid SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2"/>
            <ContentPresenter Content="{TemplateBinding Content}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            <Grid Grid.Column="1" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.Visibility>
                    <TemplateBinding Property="ShowButtonSpinner">
                        <TemplateBinding.Converter>
                            <BooleanToVisibilityConverter/>
                        </TemplateBinding.Converter>
                    </TemplateBinding>
                </Grid.Visibility>
                <RepeatButton x:Name="PART_IncreaseButton" IsTabStop="{TemplateBinding IsTabStop}" Style="{DynamicResource Xceed.Wpf.Toolkit.Themes.StaticResourceKey}">
                    <RepeatButton.ContentTemplate>
                        <DataTemplate>
                            <Path Data="M0,3C0,3 0,4 0,4 0,4 3,4 3,4 3,4 3,3 3,3 3,3 4,3 4,3 4,3 4,4 4,4 4,4 7,4 7,4 7,4 7,3 7,3 7,3 6,3 6,3 6,3 6,2 6,2 6,2 5,2 5,2 5,2 5,1 5,1 5,1 4,1 4,1 4,1 4,0 4,0 4,0 3,0 3,0 3,0 3,1 3,1 3,1 2,1 2,1 2,1 2,2 2,2 2,2 1,2 1,2 1,2 1,3 1,3 1,3 0,3 0,3z" Focusable="False" Fill="{DynamicResource Xceed.Wpf.Toolkit.Themes.StaticResourceKey}" HorizontalAlignment="Center" Height="4" SnapsToDevicePixels="True" VerticalAlignment="Center" Width="7"/>
                        </DataTemplate>
                    </RepeatButton.ContentTemplate>
                </RepeatButton>
                <RepeatButton x:Name="PART_DecreaseButton" IsTabStop="{TemplateBinding IsTabStop}" Grid.Row="1" Style="{DynamicResource Xceed.Wpf.Toolkit.Themes.StaticResourceKey}">
                    <RepeatButton.ContentTemplate>
                        <DataTemplate>
                            <Path Data="M0,1C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1z" Focusable="False" Fill="{DynamicResource Xceed.Wpf.Toolkit.Themes.StaticResourceKey}" HorizontalAlignment="Center" Height="4" SnapsToDevicePixels="True" VerticalAlignment="Center" Width="7"/>
                        </DataTemplate>
                    </RepeatButton.ContentTemplate>
                </RepeatButton>
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="{DynamicResource Xceed.Wpf.Toolkit.Themes.StaticResourceKey}"/>
            </Trigger>
            <Trigger Property="IsEnabled" SourceName="PART_IncreaseButton" Value="False">
                <Setter Property="ContentTemplate" TargetName="PART_IncreaseButton">
                    <Setter.Value>
                        <DataTemplate>
                            <Path Data="M0,3C0,3 0,4 0,4 0,4 3,4 3,4 3,4 3,3 3,3 3,3 4,3 4,3 4,3 4,4 4,4 4,4 7,4 7,4 7,4 7,3 7,3 7,3 6,3 6,3 6,3 6,2 6,2 6,2 5,2 5,2 5,2 5,1 5,1 5,1 4,1 4,1 4,1 4,0 4,0 4,0 3,0 3,0 3,0 3,1 3,1 3,1 2,1 2,1 2,1 2,2 2,2 2,2 1,2 1,2 1,2 1,3 1,3 1,3 0,3 0,3z" Focusable="False" Fill="{DynamicResource Xceed.Wpf.Toolkit.Themes.StaticResourceKey}" HorizontalAlignment="Center" Height="4" SnapsToDevicePixels="True" VerticalAlignment="Center" Width="7"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="IsEnabled" SourceName="PART_DecreaseButton" Value="False">
                <Setter Property="ContentTemplate" TargetName="PART_DecreaseButton">
                    <Setter.Value>
                        <DataTemplate>
                            <Path Data="M0,1C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1z" Focusable="False" Fill="{DynamicResource Xceed.Wpf.Toolkit.Themes.StaticResourceKey}" HorizontalAlignment="Center" Height="4" SnapsToDevicePixels="True" VerticalAlignment="Center" Width="7"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
</Window.Resources>

<Grid x:Name="LayoutRoot">
    <xctk:ButtonSpinner Height="65" Margin="164,54,268,0" VerticalAlignment="Top" Template="{DynamicResource bs}"/>
</Grid>

当我尝试编辑表达式混合4中的按钮微调器时,它会抛出一个异常,例如“typeconverter无法从system.string转换”。我只是弄乱了这个我不知道解决这个问题。我应该怎么做。

0 个答案:

没有答案