Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Help on changing Text value

Help on changing Text value

Scheduled Pinned Locked Moved C#
questioncsharpwpfhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Saiyed Alam
    wrote on last edited by
    #1

    Hello friends I have a Observable collection in my wpf window. There is a textblock in my window which text initially should be "No Message yet" (when Observable collection is empty). What I need to do is to set the text value of that textblock to " " when Observable collection changes (count becomes > 0) how Can I do this.? Any help or hints would be highly appreciated. Thanking in Advance Johnny

    M 1 Reply Last reply
    0
    • S Saiyed Alam

      Hello friends I have a Observable collection in my wpf window. There is a textblock in my window which text initially should be "No Message yet" (when Observable collection is empty). What I need to do is to set the text value of that textblock to " " when Observable collection changes (count becomes > 0) how Can I do this.? Any help or hints would be highly appreciated. Thanking in Advance Johnny

      M Offline
      M Offline
      Michel Godfroid
      wrote on last edited by
      #2

      Subscribe to the CollectionChanged event, and set your text accordingly

      S 1 Reply Last reply
      0
      • M Michel Godfroid

        Subscribe to the CollectionChanged event, and set your text accordingly

        S Offline
        S Offline
        Saiyed Alam
        wrote on last edited by
        #3

        Yes I understand I can do this using event aggregator. but I was wondering if it can be done using trigger in xaml. If it's possible plz let me know. Thanking again Johnny

        M 1 Reply Last reply
        0
        • S Saiyed Alam

          Yes I understand I can do this using event aggregator. but I was wondering if it can be done using trigger in xaml. If it's possible plz let me know. Thanking again Johnny

          M Offline
          M Offline
          Michel Godfroid
          wrote on last edited by
          #4

          Post in the C# forum, get a C# answer! Excellent tutorial on triggers at A Guided Tour of WPF – Part 4 (Data templates and triggers)[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups