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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:09:19+00:00 2026-06-02T00:09:19+00:00

I am using XAML code part of which is <DataTrigger Binding={Binding Path=Name} Value=1> <Setter

  • 0

I am using XAML code part of which is

<DataTrigger Binding="{Binding Path=Name}" Value="1">
    <Setter Property="Header" TargetName="expanderHeader" Value="Course Text"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Name}" Value="2">
    <Setter Property="Header" TargetName="expanderHeader" Value="Media Lecture"/>
</DataTrigger>
<DataTrigger    Binding="{Binding Path=Name}" Value="3">
    <Setter Property="Header" TargetName="expanderHeader" Value="Assessment"/>

<DataTrigger Binding="{Binding Path=Name}" Value="4">
    <Setter Property="Header" TargetName="expanderHeader" Value="Question"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Name}" Value="5">
    <Setter Property="Header" TargetName="expanderHeader" Value="General"/>
</DataTrigger>

Now I want to use a dataTrigger which can have values as 3, 301, 302 or 303. How can I do this.
I tried with Multidatatrigger, but it doesn’t worked. The code I tried with Multidatatrigger was:

<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding Path=Name}" Value="301"/>
        <Condition Binding="{Binding Path=Name}" Value="301"/>
        <Condition Binding="{Binding Path=Name}" Value="302"/>
        <Condition Binding="{Binding Path=Name}" Value="303"/>
        </MultiDataTrigger.Conditions>
    <Setter Property="Header" TargetName="expanderHeader" Value="Assessment"/>
</MultiDataTrigger>
  • 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-02T00:09:21+00:00Added an answer on June 2, 2026 at 12:09 am

    MultiDataTrigger applies when all of the conditions are met not any, that’s why your MultiDataTrigger isn’t working.

    Either have four separate triggers, or put the condition into a separate boolean property such as

    bool ShowAssessment
    {
        return Value == 301 || Value == 302 ...
    }
    

    raise a property change notification for ShowAssessment when Value changes

    e.g

    int Value { 
        get{ return _value; } 
        set { 
            _value = value; 
            RaisePropertyChanged("Value");
            RaisePropertyChanged("ShowAssessment");
        }
    }
    

    and then trigger on ShowAssessment.

    Probably a better solution is to add a HeaderText property with a switch statement that returns the correct header text based on Value. Then just bind the header’s text to that. No triggers required.

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

Sidebar

Related Questions

Here's a part of XAML of the application I'm working on: <ListView Name=lsvCustomerDetails ItemsSource={Binding
Here is the current code I am using: <UserControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml x:Class=ButtonPrototype.MainPage Width=640 Height=480>
I forked from thread When using MVVM pattern, should code relating to property changes
I am a beginner at using WPF. I have wrote some xaml code in
In XAML-file of the SquadView page (VfmElitaSilverlightClientView.Pages.SquadView) I am using custom value converter. XAML-file
I have authored some custom classes that I would like to create using XAML:
Is there a way to do 'using' in XAML i.e. declare a namespace and
I am trying to create a polygon using points in xaml and as per
I'm coding a windows form using WPF, XAML, C#. I have a Frame object
I'm developing a WPF app using MVVM. Most of my views have only xaml

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.