locked
How to position a border outside of hubsections but scrolling with the hub

Answers

  • Thank you for your help.

    I've got it now, I worked with negative margins.

    • Marked as answer by Löwen Johann Wednesday, April 30, 2014 8:35 PM
    Tuesday, April 29, 2014 10:00 AM

All replies

  • Which language are you using so we can help you find an appropriate forum? Is this an HTML or a Xaml hub control? Are you writing in JavaScript? C#? VB? C++?

    Sunday, April 27, 2014 4:17 PM
    Owner
  • I try to do this in XAML and VB.

    Sunday, April 27, 2014 7:48 PM
  • To allow the TextBlock to scroll with the Hub you'll need to include it in the Hub's ScrollViewer. The easiest way to do this is probably to create a new Template for the Hub. Select the Hub in the designer, right click, and choose Edit Template... Edit a copy. This will create a copy of the Hub template in the Page's resources.

    Go into that template and find the Grid's ScrollViewer. It will contain an ItemsStackPanel named "Panel" in which the HubSections will be placed. Add a Grid around the ItemsStackPanel and your TextBock in the Grid.

    Here's a quick mock-up to give you the idea:

                                    <ScrollViewer x:Name="ScrollViewer" HorizontalScrollMode="Auto" HorizontalSnapPointsAlignment="Near" HorizontalSnapPointsType="Optional" HorizontalScrollBarVisibility="Auto" Grid.RowSpan="2" VerticalSnapPointsType="Optional" VerticalScrollBarVisibility="Disabled" VerticalScrollMode="Disabled" VerticalSnapPointsAlignment="Near" ZoomMode="Disabled">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="500"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition />
                                                <RowDefinition />
                                            </Grid.RowDefinitions>
                                            <ItemsStackPanel Grid.ColumnSpan="2" Grid.RowSpan="2"  x:Name="Panel" CacheLength="20" Orientation="{TemplateBinding Orientation}"/>
                                            <TextBlock Grid.Column="0" Grid.Row="1" Foreground="Red" Text="Lorem ipsum" FontSize="72" TextAlignment="Right"/>
                                        </Grid>
                                    </ScrollViewer>

    --Rob

    Tuesday, April 29, 2014 1:50 AM
    Owner
  • Thank you for your help.

    I've got it now, I worked with negative margins.

    • Marked as answer by Löwen Johann Wednesday, April 30, 2014 8:35 PM
    Tuesday, April 29, 2014 10:00 AM