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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:12:06+00:00 2026-05-27T13:12:06+00:00

I am new to WPF technology and I am using MVVM architecture. I want

  • 0

I am new to WPF technology and I am using MVVM architecture. I want my border to change color when property bound in ViewModel changes its value. lets look at the code :

In my XAML :

<Window.Resources>
 <Style TargetType="{x:Type Border}" x:Key="LineColor">
            <Setter Property="Background" Value="Transparent"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding lcolor}" Value="Blue">
                    <Setter Property="Background" Value="Green">

                    </Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>
</Window.Resources>

I am binding it to my border :

<Border CornerRadius="1,1,0,0" Style="{StaticResource LineColor}" >

Then In my ViewModel I took simple string :

public string lcolor="Blue";

But its not working at all. Please help me out.

EDIT: I tried it as follows:

public Boolean lcolor
    {
            get { return (Boolean)this.GetValue(StateProperty); }
            set { this.SetValue(StateProperty, value); }
    }

    public static readonly DependencyProperty StateProperty = DependencyProperty.Register(
          "lcolor", typeof(Boolean), typeof(CallControlViewModel));

But it’s giving me the following error :

Error 9

“PSWGS.Client.Module.CallControl.ViewModels.CallControlViewModel’ does not contain a definition for ‘GetValue’ and no extension method ‘GetValue’ accepting a first argument of type ‘PSWGS.Client.Module.CallControl.ViewModels.CallControlViewModel’ could be found (are you missing a using directive or an assembly reference?)

  • 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-27T13:12:07+00:00Added an answer on May 27, 2026 at 1:12 pm

    Read the data binding overview and about debugging bindings, once you understood everything you may come back.

    lcolor is a field, it needs to be a property, further you might want to have a look at INPC.

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

Sidebar

Related Questions

I am new to WPF technology. i am using MVVM architecture. I want to
I'm pretty new to WPF and using the MVVM design pattern. To help learn
I am developing a game with WPF technology. I want to add new Features
Being new to WPF, and its apparently amazing ability to change, bind, enable, and
I have problem with WPF - I'm quiet new in this smart technology. So
being new to WPF this is a complex problem for me. What i want
I recently built a new application using WPF, so that I can learn the
I'm very new to this WPF technology, I started with a sticky note application
In a new WPF project (VS2010) i 'm using Unity 2 for the first
I've decided to use ClickOnce technology to deploy my new WPF application. By and

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.