0

I'm trying to create a live tile for my application, using a user control. The user control contains a grid, an image and a rectangle filled with color.

Now here comes the funny part.

I want the rectangle to act as a background for the tile's title, and the image to fill the rest of the tile. And i said to myself, well, lets put some rows in that grid and set the like you usually set them in a WPF/SL application.

I then write the entire thing in a WBM and save it to isostore.

The problem is, the parser seems to ignore the presence of grid's rows. regardless of what I try, the rectangle is not shown, and the image covers the full tile, when it should only cover the first row. It is as if the grid didn't even existed.

Another funny aspect is that it doesn't matter if I use rows or columns, the result is the same.

Any ideas?

Kara
  • 6,115
  • 16
  • 50
  • 57
mihaiconst
  • 88
  • 1
  • 7

1 Answers1

0

Are you using the following method? Dynamic LiveTile - adding background image?

I recently implemented a Live Tile using a Grid with Rows and Columns for layout of some TextBlocks. I encountered similar challenges, so I placed the control that I was using for my Live Tile on a blank page in my app to better see what was happening. Does the control render correctly when displayed on a page (versus being rendered to a WriteableBitmap)?

Another idea. Instead of trying to position the Rectangle relative to the tile's Title, why not leave the Title property blank and put the same text in a TextBlock within the user control?

If you are careful about the font and positioning of the TextBlock, the text on the resulting background image can appear indistinguishable from text displayed from the Title property. I decided to follow this strategy myself. I found the font information in the following answer: Font size and family for a tile's title

Otherwise, could you post an example of the XAML you are using?

Community
  • 1
  • 1
Michael
  • 31
  • 3
  • I am using C# to create the Gird, its rows, and setting the elements on the grid. It is basically simple sintax, there is really nothing fancy about it. I tried using the same code in a user control and it worked according to my expectation. In fact, the code works perfectly fine aside from when I use a grid. I wonder if the grid itself needs to be the children of usercontrol or phoneapplicationpage for it to work. – mihaiconst Sep 09 '12 at 21:30