Alignement in custom tile

7 posts, 0 answers
  1. Sylvain
    Sylvain avatar
    1 posts
    Member since:
    Dec 2013

    Posted 18 Dec 2013 Link to this post

    Hi,

    I have some troubles making my tile rendering properly.
    I create a user control that contains the render of my tile (two texts aligned to the bottom right corner), but when I use it in the tile, the text is the upper left corner (and left aligned).

    There is the code of my usercontrol :
    <Grid x:Name="LayoutRoot" Height="346" Width="346">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
     
        <TextBlock Text="Hello" x:Name="Text1" Style="{StaticResource PhoneTextExtraLargeStyle}" Grid.Row="1" HorizontalAlignment="Right"></TextBlock>
        <TextBlock Text="World"  x:Name="Text2" Style="{StaticResource PhoneTextHugeStyle}" Grid.Row="2" HorizontalAlignment="Right"></TextBlock>
    </Grid>

    Can you see my mistake and help me fix it please ?

    Thanks.
  2. Sylvain
    Sylvain avatar
    1 posts
    Member since:
    Dec 2013

    Posted 18 Dec 2013 Link to this post

    Actually after few changes it's a bit weirder than that:

    - If I create or update my tile in my main page (the one launched at startup) in the constructor or the onNavigatedTo, I got the tile very messy (doesn't look like it should). The purpose is to update the tile when the app is started if the tile exists.
    - If I create/update it on another page when clicking on a button, everything is ok.

    I'll try more things to try to see what is causing the issue. In the meantime, if it's a known issue, I'd like to know if there is a workaround.

    Thanks.
  3. DevCraft banner
  4. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 21 Dec 2013 Link to this post

    Hello Sylvain,

    Thanks for writing.
    I suspect that your tile looks wrong because you are probably using RadExtendedTileData. This is used to create tiles on Windows Phone 7. The old tiles have a size of 173 x 173. Since your user control is more than twice as big it won't be rendered correctly. Please use the new tile types as described here. Please experiment until you find one that looks best.
    Finally if you change your user control size to 173 by 173 it should look ok.

    Regards,
    Victor
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  5. Adan
    Adan avatar
    3 posts
    Member since:
    Apr 2013

    Posted 28 Dec 2013 Link to this post

    I have the same Issue, I'm developing a WP8 App and I'm Using RadFlipTileData
    my user control is like this
    <Grid x:Name="LayoutRoot">
            <StackPanel Margin="12">
                <TextBlock Foreground="White" FontSize="34" Name="Dowloads" TextWrapping="Wrap"/>
                <TextBlock Foreground="White" FontSize="34" Name="Event" TextWrapping="Wrap"/>
            </StackPanel>
    </Grid>
    but when I use it in the tile, the text is the upper left corner like Sylvain.

    var visualElement= new UserControls.LiveTile();  //my UserControl
     
    var tile = ShellTile.ActiveTiles.First();
    RadFlipTileData flipTileData = new RadFlipTileData()
    {
          BackVisualElement = visualElement,  //my UserControl
          IsTransparencySupported = true,
    };
    LiveTileHelper.UpdateTile(tile, flipTileData);


    I hope you can help me

    Thanks!

  6. Todor
    Admin
    Todor avatar
    778 posts

    Posted 02 Jan 2014 Link to this post

    Hello Adan,

    I have attached a project using your code but I couldn't reproduce any issues. At first the text was in the top-left corner as expected, but once I changed the alignment to center, the text is aligned as expected. Have a look and let me know what I'm missing.

    Regards,
    Todor
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  7. Rohit
    Rohit avatar
    2 posts
    Member since:
    Jan 2014

    Posted 20 Feb 2014 Link to this post

    I'm having the same problem where if I try to create/update a tile without using a button, it causes everything to align to the top left.  Is there any solution for this?
  8. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 26 Feb 2014 Link to this post

    Hi Rohit,

    Did you take a look at the project Todor has supplied?

    Is it working for you?

    Regards,
    Deyan
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
Back to Top
DevCraft banner