Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8362879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:02:42+00:00 2026-06-09T12:02:42+00:00

Below i have two control templates that are used as cell templates for two

  • 0

Below i have two control templates that are used as cell templates for two different columns in a grid. You’ll notice that both columns are bound to the same model properties (Code and Value), but use a converter to display those values differently. Both control template also use the same Style to ‘blink’ the cell when data is changed.

this works, but not exactly the way i want it. Right now, when either Data.Code or Data.Value changes, BOTH column cells Blink. What i want is if Data.Code == “CodeA”, then the column using template CDisplay2 should not blink (infact, it should not display anything). And if Data.Code == “CodeB”, then the cell using template CDisplay1 should not blink.

To achieve this it would be great if i could conditionally apply the style template based on Data.Code, but i can’t figure out how to do that. Anythoughts on this? How can i selectively apply a style to a multiple controls bound to same model property based on a particular property value?

<Style x:Key="FlashStyle" TargetType="TextBlock" >
    <Setter Property="Visibility" Value="Collapsed"/>
    <Style.Triggers>
        <EventTrigger RoutedEvent="Binding.TargetUpdated">
            <EventTrigger.Actions>
                <BeginStoryboard>
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames RepeatBehavior="4x" Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                            <DiscreteObjectKeyFrame KeyTime="0:0:0.4" Value="{x:Static Visibility.Collapsed}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger.Actions>
        </EventTrigger>
    </Style.Triggers>
</Style>

<ControlTemplate x:Key="CDisplay1" >
    <Grid>
        <TextBlock Style="{StaticResource Flash1}" >
            <TextBlock.Text>
                <MultiBinding Converter="{StaticResource conv}"  ConverterParameter="CodeA" NotifyOnTargetUpdated="True">
                    <Binding Path="Data.Code"  />
                    <Binding Path="Data.Value"  />
                </MultiBinding>
            </TextBlock.Text>
        </TextBlock>
    </Grid>
</ControlTemplate>
<ControlTemplate x:Key="CDisplay2" >
    <Grid>
        <TextBlock Style="{StaticResource Flash1}" >
            <TextBlock.Text>
                <MultiBinding Converter="{StaticResource conv}"  ConverterParameter="CodeB" NotifyOnTargetUpdated="True">
                    <Binding Path="Data.Code"  />
                    <Binding Path="Data.Value"  />
                </MultiBinding>
            </TextBlock.Text>
        </TextBlock>
    </Grid>
</ControlTemplate>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:02:43+00:00Added an answer on June 9, 2026 at 12:02 pm

    I used a trigger to set the binding conditionally. this effect of this is that FlashStyle won’t execute for both controls since some cells won’t be bound and the converter won’t be invoked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two CSS tranistions as below (they both cover the page and then
I have two tables described below. What I need is a single query that
I have an ObservableCollection<Object> that contains two different types. I want to bind this
I have two HeaderedContentControl s like those below that each have their content property
I have two identical servers. Both Win2k3. I have a web service that queues
I have two controls which are both contained within a user control. Panel location:
I have two SharePoint features, each implemented identically (see below), that add controls to
I have a user control that as shown below, for a master detail sort
I have two controls whos code are run time rendered as below: ctl00_PlaceHolderMain_SPWebPartManager_g_3c1ba10a_23ec_4ab5_b303_18f8bd7ee7e7_ctl00_gdvItinerary_ctl03_txtTravelDate ctl00_PlaceHolderMain_SPWebPartManager_g_3c1ba10a_23ec_4ab5_b303_18f8bd7ee7e7_ctl00_gdvItinerary_ctl04_txtTravelDate
I have two servlets below and work well with Tomcat7/Indigo, it will print '

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.