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
  1. Home
  2. General Programming
  3. WPF
  4. Newbie data template/DataContext question

Newbie data template/DataContext question

Scheduled Pinned Locked Moved WPF
questionwpfcsharp
3 Posts 2 Posters 12 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.
  • J Offline
    J Offline
    Jorgen Sigvardsson
    wrote on last edited by
    #1

    So I got inspired at work to learn WPF and Xaml. Cool technologies indeed, especially the data template stuff! Anyway, I've been playing around with the TreeView control. I've successfully bound it to my data structure using the HierarchicalDataTemplate element. Now to my question: how do I propagate changes in my data to the control? Resetting the DataContext property to my data didn't do anything at all (which was expected - same reference being used!).

    -- Kein Mitleid Für Die Mehrheit

    L 1 Reply Last reply
    0
    • J Jorgen Sigvardsson

      So I got inspired at work to learn WPF and Xaml. Cool technologies indeed, especially the data template stuff! Anyway, I've been playing around with the TreeView control. I've successfully bound it to my data structure using the HierarchicalDataTemplate element. Now to my question: how do I propagate changes in my data to the control? Resetting the DataContext property to my data didn't do anything at all (which was expected - same reference being used!).

      -- Kein Mitleid Für Die Mehrheit

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      If you bind to an Observeable collection your changes will automatically be displayed.

      Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

      Just a grain of sand on the worlds beaches.

      J 1 Reply Last reply
      0
      • L Lost User

        If you bind to an Observeable collection your changes will automatically be displayed.

        Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

        Just a grain of sand on the worlds beaches.

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #3

        Thanks! I will try it as soon as I get home. :)

        -- Kein Mitleid Für Die Mehrheit

        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