Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using below code for highlight red color boder for textbox.combobox when condition true from XAML

What I have tried:

<pre lang="HTML"><pre><DataTemplate>
                                        <Border x:Name="outerCellBorder">
                                            <dxe:InplaceBaseEdit Name="PART_Editor" ContentTemplate="{x:Null}"/>
                                        </Border>
                                        <DataTemplate.Triggers>
                                            <MultiDataTrigger>
                                                <MultiDataTrigger.Conditions>
                                                    <Condition Binding="{Binding Path=RowData.Row.Name}" Value="{x:Null}"/>
                                                    <Condition Binding="{Binding Path=RowData.Row.IsPersonHasValue}" Value="true"/>
                                                </MultiDataTrigger.Conditions>
                                                <Setter TargetName="outerCellBorder" Property="BorderBrush" Value="Red" />
                                                <Setter TargetName="outerCellBorder" Property="BorderThickness" Value="1" />
                                                <Setter Property="ToolTip" Value="Please enter name"/>
                                            </MultiDataTrigger>
                                        </DataTemplate.Triggers>
                                    </DataTemplate>


How to implement same functionality from WPF Codebehind or MVVM. Here, I am using Generic ViewModel like
C#
<pre> public class PersonViewModel<T> : PersonViewModel where T : new()
    {}


Please anyone help me on this.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900