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 8153163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:55:31+00:00 2026-06-06T15:55:31+00:00

Here is the psuedo code for what I want to do IF NOT ISDIRTY

  • 0

Here is the psuedo code for what I want to do

IF NOT ISDIRTY
    THEN VISIBILITY EQ VISIBILITY.COLLAPSED

IF ISDIRTY AND ISVALID        
    THEN VISIBILITY EQ VISIBILITY.VISIBLE AND COLOR = GREEN

IF ISDIRTY AND NOT ISVALID        
    THEN VISIBILITY EQ VISIBILITY.VISIBLE AND COLOR = RED

The Style for a ToggleButton below gets the conditions right on the first update but doesn’t change thereafter.

For example, if I make a change that doesn’t make the vm invalid, the color is correctly Green. But if I then make a change to make the vm invalid, it stays green, when it should be Red. Conversely, if the first update makes the vm invalid, the color is correctly set to Red, but a second update that corrects the invalid error but leaves the vm dirty does not change the color to Green.

What am I doing wrong?

I haven’t tried the Visual State Manager yet, but would that be a preferred way to go? How might that look?

Usage

        <Ellipse Style="{StaticResource EditedStateIndicatorStyle}"/>

the Style

<Style x:Key="EditedStateIndicatorStyle" TargetType="{x:Type Ellipse}">
    <Setter Property="Width" Value="8" />
    <Setter Property="Height" Value="8" />
    <Setter Property="Margin" Value="8,0"/>
    <Setter Property="SnapsToDevicePixels" Value="false" />
    <Setter Property="Focusable" Value="False" />

    <Style.Triggers>

        <!-- Dirty, && NOT Valid -->
        <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
                <Condition Binding="{Binding IsDirty}" Value="true"/>
                <Condition Binding="{Binding IsValid}" Value="false"/>
            </MultiDataTrigger.Conditions>
            <Setter Property="Fill" Value="Red"/>
            <Setter Property="ToolTip" Value="You got errors, fool!"/>
        </MultiDataTrigger>

        <!-- Dirty, but Valid -->
        <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
                <Condition Binding="{Binding IsDirty}" Value="true"/>
                <Condition Binding="{Binding IsValid}" Value="true"/>
            </MultiDataTrigger.Conditions>
            <Setter Property="Fill" Value="Green"/>
            <Setter Property="ToolTip" Value="You made changes!"/>
        </MultiDataTrigger>

        <!-- Not Dirty, don't show anything -->
        <DataTrigger Binding="{Binding IsDirty}" Value="false">
            <Setter Property="Visibility" Value="Collapsed"/>
        </DataTrigger>
    </Style.Triggers>

</Style>
  • 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-06T15:55:34+00:00Added an answer on June 6, 2026 at 3:55 pm

    If your ViewModel is implementing INotifyPropertyChanged first ensure that it is properly raising the event. Said that I recommend a simplification:

    <Style TargetType="{x:Type Ellipse}">
        ...
        <Setter Property="Fill" Value="Green" />
        <Setter Property="ToolTip" Value="You made changes!" />
    
        <Style.Triggers>
            <!-- Dirty, but NOT Valid -->
            <DataTrigger Binding="{Binding IsValid}" Value="false">
                <Setter Property="Fill" Value="Red" />
                <Setter Property="ToolTip" Value="You got errors, fool!" />
            </DataTrigger>
    
            <!-- Not Dirty, don't show anything -->
            <DataTrigger Binding="{Binding IsDirty}" Value="false">
                <Setter Property="Visibility" Value="Collapsed"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
Here's my wild and whacky psuedo-code. Anyone know how to make this real? Background:
Here is the pseudo-code for my inline query in my code: select columnOne from
Here's what I'm trying to do -- this is pseudo code and doesn't work.
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
Here is the code in a function I'm trying to revise. This example works
I'm trying to debug some legacy Integration Services code, and really want some confirmation
I'm not sure if this is possible, but here's what I would like to
Here's a pseudo code to detect screen rotate event, and decide to retain or
Consider the following psuedo T-SQL code (performed by a stored procedure): CREATE TABLE #localTable

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.