Click here to Skip to main content
15,914,409 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Switched to Silverlight 4, solution can no longer find DockPanel SOLVED Pin
fjparisIII11-May-10 6:37
fjparisIII11-May-10 6:37 
AnswerRe: Switched to Silverlight 4, solution can no longer find DockPanel Pin
Joshi, Rushikesh5-May-11 3:50
professionalJoshi, Rushikesh5-May-11 3:50 
QuestionRibbon Bar - Allow tab to change objects in view Pin
xtr33me11-May-10 5:27
xtr33me11-May-10 5:27 
Question2 MainWindows appearing Pin
Cha0sEngine11-May-10 1:49
Cha0sEngine11-May-10 1:49 
AnswerRe: 2 MainWindows appearing Pin
Jammer11-May-10 1:59
Jammer11-May-10 1:59 
GeneralRe: 2 MainWindows appearing Pin
Cha0sEngine11-May-10 2:15
Cha0sEngine11-May-10 2:15 
AnswerRe: 2 MainWindows appearing Pin
Pete O'Hanlon11-May-10 2:28
mvePete O'Hanlon11-May-10 2:28 
GeneralRe: 2 MainWindows appearing Pin
Cha0sEngine11-May-10 3:01
Cha0sEngine11-May-10 3:01 
GeneralRe: 2 MainWindows appearing Pin
Pete O'Hanlon11-May-10 3:40
mvePete O'Hanlon11-May-10 3:40 
QuestionProblem in loading a project Pin
bedathur_ganesh10-May-10 22:13
bedathur_ganesh10-May-10 22:13 
AnswerRe: Problem in loading a project Pin
Abhinav S10-May-10 22:24
Abhinav S10-May-10 22:24 
GeneralRe: Problem in loading a project Pin
bedathur_ganesh11-May-10 0:45
bedathur_ganesh11-May-10 0:45 
QuestionWPF: Add Controls To Grid At Runtime Pin
Kevin Marois10-May-10 13:32
professionalKevin Marois10-May-10 13:32 
RantRe: WPF: Add Controls To Grid At Runtime Pin
Jürgen Röhr23-May-10 8:15
professionalJürgen Röhr23-May-10 8:15 
RantMVVM makes no sense for Silverlight Pin
User 467791610-May-10 9:29
User 467791610-May-10 9:29 
GeneralRe: MVVM makes no sense for Silverlight Pin
Abhinav S10-May-10 10:03
Abhinav S10-May-10 10:03 
QuestionQuestion and thoughts about dragging objects Pin
_Zorro_10-May-10 0:20
professional_Zorro_10-May-10 0:20 
AnswerRe: Question and thoughts about dragging objects Pin
Pete O'Hanlon10-May-10 0:38
mvePete O'Hanlon10-May-10 0:38 
GeneralRe: Question and thoughts about dragging objects Pin
_Zorro_10-May-10 2:12
professional_Zorro_10-May-10 2:12 
AnswerRe: Question and thoughts about dragging objects Pin
Abhinav S10-May-10 0:40
Abhinav S10-May-10 0:40 
GeneralRe: Question and thoughts about dragging objects Pin
_Zorro_10-May-10 2:15
professional_Zorro_10-May-10 2:15 
QuestionWPF Styles and Animations Pin
DTh19789-May-10 21:28
DTh19789-May-10 21:28 
Hello

I have a question and was hoping that someone could help me. I am not too sure how to approach it.

Basically all i want to do is to change the colour of an object based on a bound value. Not only do i want the colour to change based on a bound value but for certain values i want the colour to flash also.

I have a class that I have developed that inherits framework element, i then override the onrender method to draw my object. For example a rectangle. I have a dependency property called Status of type brush which is bound using a converter. This works great for changing the colour when the bound value changes but i cannot flash the colour using this method.

I am now looking at styles and animiations to do this. but i am running into the problem of once the first animation has begun i cannot then run another animation if i am using FillBehavior="HoldEnd".

Example


<DataTrigger Value = "30" >

                    <DataTrigger.Binding>
                        <Binding RelativeSource ="{RelativeSource Self}" Path = "Width"/>
                    </DataTrigger.Binding>

                    <DataTrigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard >
                                <ColorAnimation Storyboard.TargetProperty="(Fill).(SolidColorBrush.Color)" To=" Pink" RepeatBehavior= "Forever" Duration="0:0:0.2" AutoReverse="True" ></ColorAnimation>
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>

                </DataTrigger>


                <DataTrigger Value = "40" >

                    <DataTrigger.Binding>
                        <Binding RelativeSource ="{RelativeSource Self}" Path = "Width"/>
                    </DataTrigger.Binding>

                    <DataTrigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard >
                                <ColorAnimation Storyboard.TargetProperty="(Fill).(SolidColorBrush.Color)" To="Yellow" FillBehavior="HoldEnd" ></ColorAnimation>
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>

                </DataTrigger>


---




If i run the above code once my value reaches 40 and the animation begins to change the color to Yellow. I cannot then get the animation for value 30 to work.

What i want is to change the color of my object using animations. if the bound value is for example 30 i want the color to be pink, then if the value changes to 40 i then want the color to change to yellow. I understand what the fillbehaviour does but i do not want the animation to stop until the bound value has changed.



Any ideas.



Thanks
QuestionSilverlight Date Validation Question... Pin
datahead9-May-10 10:24
datahead9-May-10 10:24 
AnswerRe: Silverlight Date Validation Question... Pin
Abhinav S9-May-10 19:25
Abhinav S9-May-10 19:25 
QuestionWPF ListView scrollable height Pin
astibich27-May-10 11:28
astibich27-May-10 11:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.