Tile sizes

5 posts, 0 answers
  1. Kenneth
    Kenneth avatar
    3 posts
    Member since:
    Feb 2013

    Posted 05 Apr 2013 Link to this post

    Hello,

    I'm using the LiveTileHelper to create some tiles from XAML.

    I'm using the RadCustomHubTile as the layout. 

    So I do something like this:

     RadFlipTileData extendedData = new RadFlipTileData()
                    {
                        VisualElement = this.myCustomHubTile
                    };

    The tile is created perfectly but it's not creating the tile full size. 

    I can get it to occupy the full size, but then I need to make the custom hub tile over 400 wide and high, which is a problem in my application. 
    Is there some way we can specify it needs to stretch to fill the contents?
  2. Kenneth
    Kenneth avatar
    3 posts
    Member since:
    Feb 2013

    Posted 05 Apr 2013 Link to this post

    Hello,

    I have been trying a few other things:

    • First of all, I stopped using the RadHubTile and I'm now using this:

    <Grid Width="173" Height="173">
            <Rectangle Style="{StaticResource Stretch}" Fill="{StaticResource PhoneAccentBrush}" />
            <Image Source="{Binding Image.Image, ElementName=root, Converter={StaticResource ImageConverter}}"  Style="{StaticResource Stretch}" />
            <TextBlock Text="{Binding Title, ElementName=root}" Style="{StaticResource TitleStyle}" />
        </Grid>

    • If I set width and height to 173 (for the normal template), the resulting tile is only half the size of the actual tile (the rest is black). If I put in 346 by 346, I get the complete tile. However, this makes my tile too big to render inside the application. (Note that although the device is 1280x768, in development you still have to work with 800x480).
    • The Icon-template has the same problem: 113x113 shows only half width and half the height. Putting 226x226 solves it
    • The wide tile template does not work at all. I'm having the following results:
    -- Width => 345, height => 173:  Half height and half width (half the width of the screen) (normal if you compare it to the other tiles)
    -- Width => 690, height = 345: Full height and 3/4 width of the screen.
    The problem in this last case is that the 690px width doesn't fit on the screen and therefor it's cut of. I tried to do it in landscape-mode and then the tile was shown correctly.

    So in essence, my question is: 
    How can we set pixels of our LayoutRoot to a value lower then needed, but have the LiveTileUpdater scale it up to the correct value?

    With kind regards,

    Kenneth Truyers
  3. DevCraft banner
  4. Todor
    Admin
    Todor avatar
    778 posts

    Posted 10 Apr 2013 Link to this post

    Hello Kenneth,

    Thank you for writing.

    What you are trying to achieve is not currently possible. When you arrange your layout and use pixels to specify the dimensions of different elements the value is in "logical pixels", but when you provide images to create live tile with the native ShellTile API, they are in "real pixels". When creating a tile from a visual element we treat the pixel values as real and we don't scale them up, as this may result in loss of quality. However, as your scenario sounds reasonable, we can consider adding a property that will allow "scaling" of the element if its size is not the same as the expected, similarly to what happens when you use the native API to create a tile from an image smaller than the expected live tile size.

    Let me know if adding such a property would be useful for you.

    Greetings,
    Todor
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  5. Kenneth
    Kenneth avatar
    3 posts
    Member since:
    Feb 2013

    Posted 10 Apr 2013 Link to this post

    Hello Todor,

    Thanks for your reply.

    In the meantime I have gone a different route for creating my tiles, because from what I saw it wasn't possible what I was trying to do.
    There's one thing I don't understand though: if on Windows Phone 8, there's no way of creating a visual element with 691px width (at least not in portrait mode), then what is the use of specifying a visual element for the wide tile?
  6. Todor
    Admin
    Todor avatar
    778 posts

    Posted 10 Apr 2013 Link to this post

    Hi,

    The VisualElement doesn't need to be displayed in order to be used in a tile. For example, you can create a UserControl that contains the layout that you need a name it for example, MyUserControl. Then you can create a tile with this element without having to display it:
    LiveTileHelper.CreateTile(new RadFlipTileData() { VisualElement = new MyUserControl() }, myUri, false);

    Another option is that the wide element is placed inside Canvas, this way, even though the element is not fully visible all of its content will get into the tile without being clipped. With the new property that we will introduce, you will be able to use smaller elements that will be stretched to fill the whole tile.

    Regards,
    Todor
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top
DevCraft banner