How to sync ui to full screen or compact mode using MediaPlayerElement

会有一股神秘感。 提交于 2019-12-25 18:43:51

问题


I'm using MediaPlayerElement, when my app window in normal size, I have a Button and a TextBox on the MediaPlayerElement. But when I click fullscreen or compact button to enter fullscreen or compact mode, they disappeared.

How to show them in full screen or compact mode?

A helpfull repo is here, sync the TextBox to fullscreen.


回答1:


For your requirement, you could custom your MediaTransportControls and found ControlPanel_ControlPanelVisibilityStates_Border in the style. Then add your element under the that border.

For example

<Border x:Name="ControlPanel_ControlPanelVisibilityStates_Border">
    <Grid>
        <TextBlock
            HorizontalAlignment="Center"
            VerticalAlignment="Top"
            FontSize="25"
            Foreground="Red"
            Text="This is title"
            />
        <Grid
            x:Name="ControlPanelGrid"
            VerticalAlignment="Bottom"
            Background="{ThemeResource SystemControlPageBackgroundAltMediumBrush}"
            RenderTransformOrigin="0.5,0.5"
......

I add the title TextBlock into the style.



来源:https://stackoverflow.com/questions/57972131/how-to-sync-ui-to-full-screen-or-compact-mode-using-mediaplayerelement

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!