Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EffectiveViewport does not work in certain cases for WinUI desktop apps #3001

Closed
ranjeshj opened this issue Jul 27, 2020 · 1 comment
Closed
Labels
appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps area-EffectiveViewport product-winui3 WinUI 3 issues

Comments

@ranjeshj
Copy link
Contributor

EffectiveViewport value obtained by elements in WinUI3 desktop apps seems to be incorrect sometimes and empty at other times.

 <Grid  HorizontalAlignment="Left" VerticalAlignment="Top">
        <TextBlock x:Name="text" HorizontalAlignment="Right" VerticalAlignment="Top"/>
        <ScrollViewer>
            <Button Width="200" Height="5000" x:Name="button" />
        </ScrollViewer>
    </Grid>

  button.EffectiveViewportChanged += Button_EffectiveViewportChanged;
  private void Button_EffectiveViewportChanged(FrameworkElement sender, EffectiveViewportChangedEventArgs args)
        {
            var viewport = args.EffectiveViewport;
            text.Text = viewport.ToString();
        }

Version Info

image

NuGet package version:
[Microsoft.WinUI 3.0.0-preview2.200713.0]

@anawishnoff
Copy link
Contributor

This has been fixed in the most recent release of WinUI 3 (Windows App SDK 0.8), so I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps area-EffectiveViewport product-winui3 WinUI 3 issues
Projects
None yet
Development

No branches or pull requests

5 participants