WPF - PathListBoxUtils 和程序集或替代方案

WPF - PathListBoxUtils and assembly or alternative

我用这段代码制作了一个带有颜色矩形的线性 PathListBox:

 <Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ec="http://schemas.microsoft.com/expression/2010/controls"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:PathListBoxUtils="clr-namespace:Expression.Samples.PathListBoxUtils;assembly=Expression.Samples.PathListBoxUtils" x:Class="Prout.MainWindow"
    Title="MainWindow" Height="1080" Width="1920">
<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="40*"/>
        <ColumnDefinition Width="Auto" MinWidth="1440"/>
        <ColumnDefinition Width="19*"/>
        <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>

    <Button Content="&lt;-" VerticalAlignment="Center" Height="19.96" Margin="0,514.52"/>
    <Button Content="-&gt;" Grid.Column="2" VerticalAlignment="Center" Height="19.96" Margin="0,514.52" Click="Button_Click"/>
    <Path x:Name="path" Data="M20.333333,280.16667 C20.333333,280.16667 315.167,48.666323 620.33367,279.33299" HorizontalAlignment="Left" Height="295.636" Margin="142.563,365.031,0,0" Stretch="Fill" Stroke="Red" StrokeThickness="2" VerticalAlignment="Top" Width="1022" Grid.Column="1"/>
    <ec:PathListBox x:Name="pathListBox" WrapItems="True" RenderTransformOrigin="0,0" SnapsToDevicePixels="True" Margin="0,0,273.949,0">

        <ec:PathListBox.LayoutPaths>
            <ec:LayoutPath SourceElement="{Binding ElementName=path}" Capacity="5" Start="0.1" Distribution="Even" FillBehavior="NoOverlap"/>
        </ec:PathListBox.LayoutPaths>
        <Rectangle Fill="AliceBlue" Height="72" Stroke="Red" StrokeThickness="2" Width="70"/>
        <Rectangle Fill="#FFA7E4E4" Height="79" Stroke="Red" StrokeThickness="2" Width="77"/>
        <Rectangle Fill="Coral" Height="77" Stroke="Red" StrokeThickness="2" Width="74"/>
        <Rectangle Fill="#FF45BF45" Height="74" Stroke="Red" StrokeThickness="2" Width="74"/>
        <Rectangle Fill="#FFDEA9DE" Height="78" Stroke="Red" StrokeThickness="2" Width="76"/>
    </ec:PathListBox>
</Grid>

看起来像这样:

请原谅我的新手,但我想使用发布在这个主题中的库 http://expressionblend.codeplex.com/releases/view/44915 这是用于 Blend 4 的 PathListBoxUtils。 我正在使用新的 Blend for Visual Studio 2013 update 4,并且我曾天真地尝试让程序集在我的版本中工作。 但是,当我尝试使用 PathLayoutItemTransformer 时,它无法在 .NET 4.5.1(这是我当前的构建框架)下运行,但显然在 .NET 4 下运行良好。

有没有办法将库移植到 4.5.1,或者只使用需要的 类?或者我是否必须寻找 PathListBox 的替代品?

我想我有点迷茫,我希望这个愚蠢的错误可以帮助其他人找到答案。 我所做的只是在这里获取源代码:Source code of Expression Blend Samples。 从那里,我只是 导入了我感兴趣的 类 并将构建的框架更改为 4.5。控件和行为神奇地出现在 Blend 中,我能够完全使用 类。 无论如何,抱歉打扰了。

编辑: 我有另一个可能对某人有帮助的技巧。我已将目标 CPU 更改为 x64,这就是为什么我没有在 Blend 中看到 prope 设计的原因。将它改回 x32 帮助我看到了设计。