Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Set a Value For a Property in a DataItem Within DataTriggers ... Could That Be Possible????
posted

Hey Everybody .. Let's Go To The Problem :( ... Here's Some Code That Will Clarify What I Need:

<InfraDP:XamDataGrid.Resources>
                <Style TargetType="{x:Type InfraDP:CellValuePresenter}">
                    <Setter Property="Background" Value="White" />
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Mode=TwoWay, RelativeSource={RelativeSource Self}, Path=Record.DataItem.IsChanged}"  Value="True">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource storyboard1}">

                                     <Storyboard AutoReverse="True" >
                                          <ColorAnimation Storyboard.TargetProperty="(Control.Background).               (SolidColorBrush.Color)"  From="White" To="Red" Duration="0:0:1" />
                                   </Storyboard>                                   
                                </BeginStoryboard>
                            </DataTrigger.EnterActions>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </InfraDP:XamDataGrid.Resources>

 

this code is doing something like a flush effect for a record which its "IsChanged" Property is set to true.

What I Really Want Here .. Is How Can I Set "Record.DataItem.IsChanged" back to false from whithin the XAML Code.. I Need It. ... Thanks in Advance

Parents
No Data
Reply
  • 9694
    posted

    Hello,

    I apologize no one has responded to this post until now. I was wondering if you found a way to solve this issue?

    I think the best way to solve this and make it a pure XAML approach in the XamDataGrid code would be to create a custom control (could be an actual custom control or a UserControl or a class derived from the control the field is already using, such as XamCheckEditor). The custom control would be two way bound to the data (could be the IsChecked property). It would encapsulate the animation effect. And would have a Completed handler that would reset the two way bound property back to False after the animation completed.

    Please let me know if you would like further help on this.

    Thank you,

Children