【问题标题】:Global seek bar MediaElement wp7全局搜索栏 MediaElement wp7
【发布时间】:2011-08-11 18:29:44
【问题描述】:

如何在 WP7 中为音频播放器创建全局搜索栏?我想创建这样的东西

【问题讨论】:

  • 您有问题吗?
  • 我怎样才能实现这一点?我要求甚至实现这一点,而不是代码。首先我添加var _pop = new Popup { Child = mediaelelement, IsOpen = true };,我可以在所有页面上播放音频

标签: c# silverlight windows-phone-7 mediaelement seekbar


【解决方案1】:

将必要的控件添加到应用程序框架,而不是一个/每个页面。

在 app.xaml 中添加如下内容:

<Application.RootVisual>
    <phone:PhoneApplicationFrame x:Name="RootFrame"
           Navigated="CompleteInitializePhoneApplication"
           NavigationFailed="RootFrame_NavigationFailed">
        <phone:PhoneApplicationFrame.Template>
            <ControlTemplate>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="700"/>
                        <RowDefinition Height="100"/>
                    </Grid.RowDefinitions>
                    <Grid Grid.Row="0" x:Name="ClientArea">
                        <ContentPresenter />
                    </Grid>

                    <Grid Grid.Row="0">
                        // your controls here
                    </Grid>
                </Grid>
            </ControlTemplate>
        </phone:PhoneApplicationFrame.Template>
    </phone:PhoneApplicationFrame>
</Application.RootVisual>

【讨论】:

  • 我需要在 App.xaml.cs 中做吗?请给我正确的方向,我可以在哪里找到有关它的材料。
  • @wsevendays。在 app.xaml 中执行此操作将是最简单的。查看更新的答案
  • 我无法让它工作。 youtube.com/watch?v=6j0Vu0mvrNo ...&lt;ContentPresenter/&gt; &lt;/Grid&gt; &lt;Grid Grid.Row="0"&gt; &lt;Button Content="hello" Height="100" Width="300"/&gt; &lt;/Grid&gt; &lt;/Grid&gt;...
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-06-23
  • 1970-01-01
  • 2023-03-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多