【问题标题】:Windows Phone Universal App Hide Hub Section or create dynamicallyWindows Phone 通用应用程序隐藏集线器部分或动态创建
【发布时间】:2015-02-07 00:14:11
【问题描述】:

我有时想隐藏一个 Hub 部分,或者我想动态创建 id 以便我可以决定显示什么

 <HubSection HeaderTemplate="{StaticResource HubItemHeader}" 
                        Header="{Binding MyViewModel}" 
                        DataContext="{Binding MyViewModel}" 
                        ContentTemplate="{StaticResource MyList}" 
                        Visibility="{Binding IsDisplayed, Converter={StaticResource BoolToVisibilityConverter}}" />

我试过了,但是没用

【问题讨论】:

    标签: windows windows-phone universal


    【解决方案1】:

    您可以在 C# 中动态添加 Hub 部分

    HubSection hubSection= new HubSection();
    
    this.Hub.Sections.Add(theHubSection);
    

    阅读: https://social.msdn.microsoft.com/Forums/en-US/7c9b4355-59de-4a5a-bf7d-3459a2ee760d/adding-hubsections-dynamically?forum=w81prevwCsharp

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-25
      • 1970-01-01
      • 2011-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-18
      • 1970-01-01
      相关资源
      最近更新 更多