Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - WPF trigger problem

Reply
 
Old 09-12-2009   #1 (permalink)
Dmitry Nogin


 
 

WPF trigger problem

Hi,

I have the following markup (Slider and Button):

<StackPanel Margin="10">
<Slider Name="slider" Minimum="0" Maximum="10" Value="0"/>
<Button Name="btn" Content="5">
<Button.Style>
<Style>
<Style.Triggers>
<Trigger Property="Button.IsPressed" Value="True">
<Setter TargetName="slider" Property="Value"
Value="5"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</StackPanel>

I would like the button to adjust slider position.
But I have the following error message at the Setter's line:

"Value 'Value' cannot be assigned to property 'Property'. Cannot find the
Trigger
target 'slider'. (The target must appear before any Setters, Triggers, or
Conditions that use it.)"

What did I do wrong?


Thanks,
-- dmitry


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
problem with vb.net and trigger in vfpro .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46