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

  • Home
  • SEARCH
  • 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 8485835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:45:40+00:00 2026-06-10T20:45:40+00:00

I have Image <Image HorizontalAlignment=Left VerticalAlignment=Top Source= Width=20 Height=20 /> and I have variable

  • 0

I have Image

<Image HorizontalAlignment="Left"  VerticalAlignment="Top" Source="" Width="20" Height="20" />

and I have variable bool IsOk in codebehind.
How can I bind it to source property and have condition that when it is true source will be “../Shared/Images/ok.png” and when false “../Shared/Images/cancel.png”?
Can I use to it triggers?

  • 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-10T20:45:42+00:00Added an answer on June 10, 2026 at 8:45 pm

    Marty’s answer is clean, but if you really just feel like using a trigger…something like this might work also, but like I said, Marty’s is cleaner. 🙂

    <Image HorizontalAlignment="Left"  VerticalAlignment="Top" Source="" Width="20" Height="20">
              <i:Interaction.Triggers>
                    <ei:DataTrigger Value="False"
                                    Binding="{Binding BooleanValueBinding}">
                      <ei:ChangePropertyAction PropertyName="Source"
                                               Value="../Shared/Images/cancel.png" />
                    </ei:DataTrigger>
                    <ei:DataTrigger Value="True"
                                    Binding="{Binding BooleanValueBinding}">
                      <ei:ChangePropertyAction PropertyName="Source"
                                               Value="../Shared/Images/ok.png" />                  
                    </ei:DataTrigger>
              </i:Interaction.Triggers>
        </Image>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an image control as: <Image Height=209 HorizontalAlignment=Left Margin=66,74,0,0 Name=image1 Stretch=Fill VerticalAlignment=Top Width=200
In my XAML, I have: <Image Height=150 HorizontalAlignment=Left Margin=0,4,0,0 Name=imgLogo Stretch=Fill VerticalAlignment=Top Width=417 />
I have listbox like this: <ListBox Height=589 HorizontalAlignment=Left Name=AllNotesListBox VerticalAlignment=Top Width=460 SelectionChanged=AllNotesListBox_SelectionChanged> <ListBox.ItemTemplate> <DataTemplate>
I have a code like that: <ListBox Height=522 HorizontalAlignment=Left Margin=20,162,0,0 Name=listBox1 VerticalAlignment=Top Width=448 >
I have a listbox, with custom items. Code: <ListBox Height=600 HorizontalAlignment=Left Margin=7,6,0,0 Name=friendList VerticalAlignment=Top
I have the following XAML code : <Image Source="a.jpg" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Uniform"/> and I,
I have image map that can I move, but this map will be so
So I have Image like this (source: de-viz.ru ) I want to get something
So I have Image like this (source: de-viz.ru ) I want to get something
In my Canvas, I have an image object. I haven't set a source in

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.