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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:19:15+00:00 2026-05-11T16:19:15+00:00

I have an ImageBrush within a Rectangle that I’m trying to fade in on

  • 0

I have an ImageBrush within a Rectangle that I’m trying to fade in on load, by increasing the opacity from 0 to 100.

Here’s what I have:

    <Rectangle HorizontalAlignment="Left" Width="200" Stroke="#FF000000" StrokeThickness="0" Fill="{DynamicResource MyImageBrush}" >            
        <Rectangle.Resources>
            <ImageBrush x:Name="ImgBrush" x:Key="MyImageBrush" ImageSource="tower.jpg" Stretch="UniformToFill" Opacity="0" >
            </ImageBrush>                
        </Rectangle.Resources>   
        <Rectangle.Triggers>
            <EventTrigger RoutedEvent="Rectangle.Loaded">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation x:Name="FadeIn" Storyboard.TargetName="ImgBrush"  Storyboard.TargetProperty="Opacity" From="0" To="100" Duration="0:0:5"/>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>                              
        </Rectangle.Triggers>
    </Rectangle>

The error that is thrown is:

‘ImgBrush’ name cannot be found in the name scope of ‘System.Windows.Shapes.Rectangle’

(ImgBrush being specified in Storyboard.TargetName)

What can I do to resolve this?

  • 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-05-11T16:19:15+00:00Added an answer on May 11, 2026 at 4:19 pm

    Got around this by animating the opacity of the whole rectangle, rather than trying to animate the whole imageBrush.

         <Rectangle Name="LeftRectangle" Opacity="0" HorizontalAlignment="Left" Width="200" Stroke="#FF000000" StrokeThickness="0" Fill="{DynamicResource MyImageBrush}" >            
            <Rectangle.Resources>
                <ImageBrush x:Name="ImgBrush" x:Key="MyImageBrush" ImageSource="tower.jpg" Stretch="UniformToFill" Opacity="100" >
                </ImageBrush>                
            </Rectangle.Resources>   
            <Rectangle.Triggers>
                <EventTrigger RoutedEvent="Rectangle.Loaded">
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation x:Name="FadeIn" Storyboard.TargetName="LeftRectangle"  Storyboard.TargetProperty="Opacity" From="0" To="100" Duration="0:4:5"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>                              
            </Rectangle.Triggers>
        </Rectangle>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rectangle that looks like this <Rectangle x:Name=rect Width=76 Height=76 HorizontalAlignment=Left> <Rectangle.Fill>
I have a 3D plane which I'm trying to render with an ImageBrush as
I have an ImageBrush and a SolidColorBrush. The thing is that I, now, want
I have a Rectangle Shape in Silverlight that is rotated 15 degrees. It is
I have a canvas that I want sized to fit a background ImageBrush. One
I have an image (embedded resource) that i can get access to and form
I have a WPF Application where I am trying to make a close button
Im trying to create a PNG sequencer class that will allow me to change
I have an imagebrush of a soccer field as the page background and I
I have the following XAML that displays a cover image for a book using

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.