I am trying to build an annuciator panel containing 110 indicators. Each indicator will contain some text, which will not change. It will be surrounded by a single pixel border. The background of the indicator will be one of three colors, which will indicate status. Tapping on a indicator will cause an infomation box to open.
So far, I am using a TextBox for each indicator. Using a canvas, I am able to draw a border around each TextBox.
The point at which I am stuck is drawing the background color for each indicator.
The Canvas class has a DrawRectange method which appeared to have the ability to draw the border and color the background. But, I believe that the Canvas is rendered after the control and would oblivate the text. Further, the indicator color can change often. There is not a method to remove drawing actions from the Canvas or even clear it. So the Canvas method does appear to be the way to go.
My next thought was keep the border in the Canvas, but create a class which inherits from TextBox, and override the Render method. I could then do the indicator color before calling base.Render(). I would use a FillRect to create the indicator color.
In looking at the FillRect methods, the documentation says the passed rectangle would be filled with the background image, or a color. But, there is no method which takes a color.
I could create a bitmap which is screen size, set it to be the background image for the window and then do the fill into the bitmap and use Window.FillRect to get the color into place.
Before I spend more time trying different ways of implementing what I want, I thought I would solicit advice. I get the feeling I might be missing an easy solution.
**** Got a chance to try using a background image for the window for coloring the indicator background and it appears to work. I still have to check it when switching between windows, but I think it will continue to work.
*** Still interested in other ways of doing it.