wpf-triggers

WPF DataTrigger on any data (binding) change

Hi, I want to begin a storyboard, every time my Image source changes. I have implemented INotifyPropertyChanged. Can anyone help me achieve this? Thanks, <Image Name="pic" HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding ElementName=uc, Path=Image}"> <Image.Resources> <Storyboard x:Key="pic...

Exception: “Missing key value on ‘Storyboard’ object.” with styled triggers

I'm restyling a button, and that includes providing a controlTemplate and also adding some triggers (for mouseenter and mouseleave). My XAML is as follows: <Style TargetType="Button"> <Style.Resources> <Color x:Key="ForeColour" R="128" G="128" B="128" A="255"/> <Color x:Key="BackColour" R="211" G="211" B="211" A="...

When IAttachedObject.Detach() (KeyTrigger.Detaching()) method is actually called?

Let's say I have a Silverlight user control with a textbox: <TextBox> <ii:KeyTrigger Key="Enter"> <!-- something here --> </ii:KeyTrigger> </TextBox> I inject my user control into root content control: root.Content = new MyUserControl(); Now I know that KeyTrigger will be hooked up to TextBox when "Loaded" event of MyUser...

WPF Trigger not working (sample)...

I have a custom WPF Line, that I whant to change the Style when selecting with mouse. I tried to use triggers(see code bellow), but this does not work. Where is the problem? The IsSelected property is changed, but the StrokeThickness does not change at all... ( XAML: <UserControl.Resources> <Style TargetType="stops:MyLine" x:Key...

Is it possible for a button click to permanently change an image's source using only a XAML trigger?

I'm trying to solve the following problem on a WPF datagrid: I've templated the DataGrid items to contain a button - when clicked, it displays the RowDetails for the grid. I'm having trouble getting that button styled the way I want. Specifically, I want it to appear as a "hyperlink" with a small plus-sign icon next to it. When clicked ...

WPF Control Template Trigger, how to reference sub object

I have AnswerContainer class which is inherited from ContentControl. The AnswerContainer has a public dependency property called Answer. public class AnswerContainer : ContentControl { public static DependencyProperty AnswerProperty; public Answer Answer { ... Answer property is of type Answer and has a public dependen...

How to disable animation in WPF button

Hello, I have this WPF 4 code: <Button Content="{Binding Path=Header}" Command="{Binding Path=Command}" CommandParameter="{Binding Path=CommandParameter}" Focusable="False"> <Button.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="White" Offset="0"/> <Gradient...

How to change image\parameters on style definition ?

I define some new button style. The style default background is image X.bmp and when on 'mouseOver' is true the image is changing to Y.bmp I have 10 buttons on the code that need to use this style - and each of the button need to show different image as default different image on 'mouseOver' event. I can set the bitmap on each butto...