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

[BUG] Frame会导致Lyric页面的AMLL组件中的LyricBox.ActualHeight为0 #68

Open
Miaoyww opened this issue Oct 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working confirmed

Comments

@Miaoyww
Copy link
Owner

Miaoyww commented Oct 19, 2024

            bool isNewLoaded = false;
            if (LyricBox.TryGetElement(k) is { } ele)
            {
                actualElement = ele;
            }
            else
            {
                actualElement = LyricBox.GetOrCreateElement(k); // 引发的异常:“System.Runtime.InteropServices.COMException”(位于 WinRT.Runtime.dll 中)
                isNewLoaded = true;
            }
            if (!isNewLoaded)
            {
                var transform = actualElement?.TransformToVisual(LyricBoxContainer.ContentTemplateRoot);
                var position = transform?.TransformPoint(new Point(0, 0));
                var offset = (position?.Y + LyricHost.Margin.Top) - 200; // 切换frame后始终为-200,即 LyricHost.Margin.Top 为0
                Debug.WriteLine(offset);
                LyricBoxContainer.ChangeView(0,
                    offset, 1,
                    false); 
            }
            else
            {
                actualElement.StartBringIntoView();
            }

LyricBox.ActualHeight == 0

可能的解决方案

修改MainWindow.xaml使歌词独立于ShellPage之外,不受Frame管理

@Miaoyww Miaoyww added the bug Something isn't working label Oct 19, 2024
@Miaoyww Miaoyww self-assigned this Oct 19, 2024
@Miaoyww
Copy link
Owner Author

Miaoyww commented Oct 19, 2024

目前的解决方案是,打开歌词后不切出页面,或者是重新打开应用。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed
Projects
None yet
Development

No branches or pull requests

1 participant