Silverlight / WPF - Changing Border/Background color while binding the record WPF,MVVM

Asked By Kannabiran . on 24-Apr-13 03:15 AM

Hi all,
i am using MVVM architecture in WPF application, right now its working fine as when i made some changes in the Costcenter cell onlostfocus the bordercolor or background color will get change, like wise the color should get changed while its binding itself when the data is populated in the gris itshould be highlighted. How can i do that any idea? My working code is below.since im very new to this getting struck.

<Style x:Key="costCenterStyle" TargetType="{x:Type igDataPresenter:CellValuePresenter}" BasedOn="{StaticResource isEditableStyle}" >
            <DataTrigger Binding="{Binding Path=DataItem.IsChanged[CostCenter]}" Value="Changed">
              <Setter Property="Background" Value="LightSalmon"/>
            <DataTrigger Binding="{Binding Path=DataItem.IsChanged[CostCenter]}" Value="ChangedButNotCommited">
              <Setter Property="BorderThickness" Value="2"/>
              <Setter Property="BorderBrush" Value="LightSalmon"/>

 <igDataPresenter:Field Name="CostCenter" Label="Cost Center">
                  CellValuePresenterStyle="{StaticResource costCenterStyle}"/>

Kannabiran B