0
我用Blend 4創建了一個自定義控件來自定義一個Slide對象。這裏有一個由Blend生成的snipet代碼:Silverlight Slider CustomConstrol屬性不可用
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="SilverlightControlCustomSlider.CustomSlider"
d:DesignWidth="640" d:DesignHeight="480">
<UserControl.Resources>
<Style x:Key="SliderStyle1" TargetType="Slider">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Maximum" Value="10"/>
<Setter Property="Minimum" Value="0"/>
<Setter Property="Value" Value="0"/>
<Setter Property="BorderBrush">
然後我構建了項目並將其導入到VS2010中。我可以創建自定義滑塊的實例,它具有相同的外觀和全部。但是,屬性值,最大值和最小值(以及其他值)不可用。像自定義控件沒有從滑塊繼承。我究竟做錯了什麼?
謝謝
謝謝我不明白它是如何工作的!我將這種風格應用於滑塊,並且工作得很好! – 2011-06-02 19:54:35