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. How would you design this?

How would you design this?

Scheduled Pinned Locked Moved WPF
wpfcsharpdesigndata-structuresarchitecture
1 Posts 1 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
    SledgeHammer01
    wrote on last edited by
    #1

    I've got a control that displays data (List). My control supports a few different types of status indicators to mark the data. I'd like to allow the user of my control the ability to customize the appearance (color) of the markers. I'm having a little trouble coming up with a way to design that in a MVVM friendly way. I'm thinking an IValueConverter of some sort possibly... However... well, let me give you a real world example: One type of status indicator is the min/max style. So I'll mark the min item and the max item. If the converter takes just the arbitrary T value, the implementer of the converter would have no way of knowing if it was the min item or the max item. So I was thinking of having an IMultiValueConverter at the control level and in this case, I would pass in the min value in [0] and the max value in [1] and the implementer would return an array[2] of brushes. Otherwise, I'd have to call the converter for each individual value and pass in a min / max indicator, so it would still need to be a multi value converter. I haven't really seen a control that does that LOL, so I'm not quite sure that's the WPF / MVVM way... Any ideas?

    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