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. Implement Layers on top of Canvas in WPF - How to

Implement Layers on top of Canvas in WPF - How to

Scheduled Pinned Locked Moved WPF
csharpwpftutorialquestion
3 Posts 3 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.
  • J Offline
    J Offline
    John ph
    wrote on last edited by
    #1

    each object on Canvas can be added to one of the layer (say layer 1, 2, 3) and is hidden. only one layer is visible at a time and only targetted portion of the layer show expose the object in it. any idea how to acheive this in wpf???

    - Regards -
       J O N


    A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers


    P A 2 Replies Last reply
    0
    • J John ph

      each object on Canvas can be added to one of the layer (say layer 1, 2, 3) and is hidden. only one layer is visible at a time and only targetted portion of the layer show expose the object in it. any idea how to acheive this in wpf???

      - Regards -
         J O N


      A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers


      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      There are many different ways of achieving this, and the answer really depends on what you are most comfortable with: You could add multiple canvases, and just display one depending on the particular one you need. You could implement one canvas, with a collection of layer items which contains as properties, the objects you want to display and a single flag determining whether or not the layer was visible. You could have a collection of all objects (this is the one I wouldn't choose if I were you), and have a flag on each determining whether or not it was visible.

      I'm not a stalker, I just know things. Oh by the way, you're out of milk.

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      1 Reply Last reply
      0
      • J John ph

        each object on Canvas can be added to one of the layer (say layer 1, 2, 3) and is hidden. only one layer is visible at a time and only targetted portion of the layer show expose the object in it. any idea how to acheive this in wpf???

        - Regards -
           J O N


        A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers


        A Offline
        A Offline
        Abhinav S
        wrote on last edited by
        #3

        Canvas.Zorder should help you out.

        The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.

        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