• 0

XAML Scrollviewer not scrolling: WP8


Question

Why in the heck is the ScrollViewer not doing anything?  I've been checking a number of options but no matter what, the text (filled via C#) does not scroll

 <Grid x:Name="LayoutRoot" Background="DarkRed">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="0,0,0,4" Grid.ColumnSpan="2">
            <Grid x:Name="TitlebarGrid">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="55"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="55"/>
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0" Height="48" Width="48" Source="/Assets/TinyTrain.png" Margin="4,5,4,4" />
                <Image Grid.Column="2" Height="48" Width="48" Source="/Assets/TinyTrain.png" Margin="50,5,-50,4" >
                    <Image.RenderTransform>
                        <ScaleTransform ScaleX="-1"/>
                    </Image.RenderTransform>
                </Image>
                <TextBlock HorizontalAlignment="Center" Grid.Column="1" Text="Big Apple Transit" FontSize="38" FontWeight="Bold" Style="{StaticResource PhoneTextNormalStyle}" Margin="0,0,0,0"/>
            </Grid>
        </StackPanel>

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="0" Background="White" >
            <ScrollViewer Grid.Column="1" Height="auto" VerticalScrollBarVisibility="Visible" AllowDrop="False">
                <TextBlock Name="LineDetails" Opacity="0.0" Foreground="DarkRed" FontSize="24" TextWrapping="Wrap" />
            </ScrollViewer>
            
            <ListBox Name="BATList" Opacity="1.0" Foreground="DarkRed" FontSize="33" Margin="5" SelectionChanged="BATList_SelectionChanged">
                <ListBox.Resources>
                    <SolidColorBrush x:Key="AppAccentBrush" Color="#c0c0c0"></SolidColorBrush>
                </ListBox.Resources>
            </ListBox>
        </Grid>
    </Grid>
Link to comment
https://www.neowin.net/forum/topic/1173323-xaml-scrollviewer-not-scrolling-wp8/
Share on other sites

4 answers to this question

Recommended Posts

  • 0

A quick look at your xaml shows a few things:

The listbox is overlaying the scrollviewer

The scrollviewer has grid.column="1" set on it however the grid it's hosted in doesn't define any row or column definitions.

A textbox with wrap doesn't really need a scrollviewer as it has one within it's controltemplate to do... scrolling.

  • 0
  On 27/08/2013 at 13:42, SledgeNZ said:

A quick look at your xaml shows a few things:

The listbox is overlaying the scrollviewer

The scrollviewer has grid.column="1" set on it however the grid it's hosted in doesn't define any row or column definitions.

A textbox with wrap doesn't really need a scrollviewer as it has one within it's controltemplate to do... scrolling.

 

The ListBox is over the ScrollViewer because when the user selects a row in the ListBox the ListBox's Opacity is set to 0.0 so that the TextBlock is visible in the same space.   I have tried the ScrollViewer without the Grid.Column value as well (and wow, duh about the lack of Grid definitions) 

I have also tried the TextBlock with and without the WRAP but still not working

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="0" Background="White" >
                <TextBlock Name="LineDetails" Opacity="0.0" Foreground="DarkRed" FontSize="24" TextWrapping="Wrap" />           
            <ListBox Name="BATList" Opacity="1.0" Foreground="DarkRed" FontSize="33" Margin="5" SelectionChanged="BATList_SelectionChanged">
                <ListBox.Resources>
                    <SolidColorBrush x:Key="AppAccentBrush" Color="#c0c0c0"></SolidColorBrush>
                </ListBox.Resources>
            </ListBox>
        </Grid>
    </Grid>

Thanks for the feedback though.

  • 0
  On 27/08/2013 at 14:32, SledgeNZ said:

If you remove the listbox from the 2nd grid does the text wrap? Could be it's contents are forcing the width of it's host grid to be extended beyond the bounds of your page.

 

This didn't work:

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="0" Background="White" >
            
                <TextBlock Name="LineDetails" Opacity="1.0" Foreground="DarkRed" FontSize="24" TextWrapping="Wrap" />           
            
        </Grid>

This did work:

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="0" Background="White" >
            <ScrollViewer Grid.Column="1" Height="auto" VerticalScrollBarVisibility="Visible" AllowDrop="False">
                <TextBlock Name="LineDetails" Opacity="1.0" Foreground="DarkRed" FontSize="24" TextWrapping="Wrap" />
            </ScrollViewer>
        </Grid>

So I'll have to look into how to show the controls.   Thank you very much

This topic is now closed to further replies.
  • Posts

    • UniGetUI 3.3.1 by Razvan Serea UniGetUI is an application whose main goal is to create an intuitive GUI for the most common CLI package managers for Windows 10 and Windows 11, such as Winget, Scoop and Chocolatey. With UniGetUI, you'll be able to download, install, update and uninstall any software that's published on the supported package managers — and so much more. UniGetUI features Install, update and remove software from your system easily at one click: UniGetUI combines the packages from the most used package managers for windows: WinGet, Chocolatey, Scoop, Pip, Npm and .NET Tool. Discover new packages and filter them to easily find the package you want. View detailed metadata about any package before installing it. Get the direct download URL or the name of the publisher, as well as the size of the download. Easily bulk-install, update or uninstall multiple packages at once selecting multiple packages before performing an operation Automatically update packages, or be notified when updates become available. Skip versions or completely ignore updates in a per-package basis. Manage your available updates at the touch of a button from the Widgets pane or from Dev Home pane with UniGetUI Widgets. The system tray icon will also show the available updates and installed package, to efficiently update a program or remove a package from your system. Easily customize how and where packages are installed. Select different installation options and switches for each package. Install an older version or force to install a 32bit architecture. [But don't worry, those options will be saved for future updates for this package] Share packages with your friends to show them off that program you found. Here is an example: Hey @friend, Check out this program! Export custom lists of packages to then import them to another machine and install those packages with previously-specified, custom installation parameters. Setting up machines or configuring a specific software setup has never been easier. Backup your packages to a local file to easily recover your setup in a matter of seconds when migrating to a new machine UniGetUI 3.3.1 changelog: Adress executable corruption/integrity detection and semi-automatic resolution: UniGetUI will check for corruption issues. If found, the user will be prompted to repair them. The crash report will contain an integrity report In both cases, if UniGetUI detects an integrity violation and the UniGetUI installer is placed on the installation directory (which will be by default since this release), UniGetUI will ask the user to confirm to start an automated reinstall process. UniGetUI can be reinstalled from Windows Apps and Features -> UniGetUI -> Modify. This will force a reinstall Fixed crashes and issues with GitHub cloud backup and GitHub login Fixed an issue where certain in-app popups wouldn't show the acrylic background properly Migrated to AppSdk Titlebar, and removed WinUIEx as a dependency Improvements to UniGetUI Elevator Fix a few UI crashes and deadlocks involving loading dialogs Reverted a Toolbar UI change that combined different options into a menu. Now the main action has its own button again Other fixes and improvements What's Changed Update icons and screenshots from the excel file by @github-actions[bot] in #3884 Load translations from Tolgee by @martinet101 in #3937 Download: UniGetUI 3.3.1 | 53.3 MB (Open Source) Links: WingetUI Home Page | GitHub | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • You have reported this issue at least once into their feedback hub?
    • You can disable Chrome on Android and forget that it even exists, you can do the same for Safari in Apple's operating systems. Only ChromeOS is tied with Chrome because the whole OS is Chrome. Safari doesn't have dominant market share but Apple allows you to disable Safari. So why exactly we can't have the same with Edge and only EU Windows users can uninstall Edge? There isn't any valid reason having Edge, the browser, needed for any other app, for widgets etc. That is what Edge webview2 is for.
    • China throws a wrench into Nvidia's H20 comeback plan by Paul Hill China’s Cyberspace Administration (CAC) has summoned Nvidia over alleged security vulnerabilities in its H20 chips. The CAC said that the chips have serious security issues with specific concerns over tracking and positioning and remote shutdown technologies. This development poses a big hurdle for Nvidia just as H20 sales were set to resume after the US reversed a ban that was first imposed in April. According to CNBC, Nvidia had already taken a $4.5 billion writedown on the unsold H20 inventory in May and said sales in its last financial quarter would have been $2.5 billion if export curbs could have been avoided. The CAC is concerned about the chips because of calls from US lawmakers for mandatory tracking features on advanced chip exports. For example, the proposed US Chip Security Act from Senator Tom Cotton and others would require location reporting and remote modification capabilities. If these backdoors have already been baked in, or get added in the future, China would view them as a threat to national security and data privacy. US lawmakers argue that these tracking capabilities are needed to prevent chip smuggling to ensure compliance with export controls which also apply to China. Given its actions, the CAC has reason to believe that the tracking technology is already present. Nvidia CEO Jensen Huang recently visited the Chinese capital, Beijing, to signal the company’s commitment to the Chinese market and announced the resumption of sales of the H20. It is believed that Nvidia placed new orders for 300,000 H20 chipsets with TSMC to meet the anticipated demand. Given the CAC’s decision, it could mess up Nvidia’s plans and force it to consider new ways to navigate US export policies and retain its lucrative China market share. The US is keen to hamper China's AI efforts so that it maintains a lead in the AI race. By limiting access to powerful hardware, it forces China to make more efficient models, or develop powerful hardware itself, slowing down its progress.
    • I had two previous startups where I ran that same command and it took me thru different oobe/first-run setup processes.  After I finished those and went ahead and signed into my Microsoft account (since I was gonna use it to stream XBox anyway), the next time I ran my command, instead of doing what I wanted, I got whatever in the heck that thing was that started talking to me. I installed regular Chromium, told it to go to that URL in kiosk mode and it did exactly, and ONLY that.  No sign in requests, no data syncing setup, no CoPilot or AI nonsense, nothing.  It just opened in kiosk mode and went to the site I told it to.
  • Recent Achievements

    • Week One Done
      whiloh earned a badge
      Week One Done
    • Week One Done
      memnoch earned a badge
      Week One Done
    • First Post
      UAVXP earned a badge
      First Post
    • Dedicated
      Xinotema earned a badge
      Dedicated
    • Rookie
      MrNukes went up a rank
      Rookie
  • Popular Contributors

    1. 1
      +primortal
      664
    2. 2
      ATLien_0
      207
    3. 3
      Xenon
      133
    4. 4
      neufuse
      124
    5. 5
      Michael Scrip
      122
  • Tell a friend

    Love Neowin? Tell a friend!