简体   繁体   English

Windows IOT Core中没有DockPanel吗

[英]Is DockPanel not available in Windows IOT Core

I'm trying to make my first Universal Windows app for Windows IOT Core. 我正在尝试制作用于Windows IOT Core的第一个通用Windows应用程序。 I'm reusing some code that I had previously used on a regular Windows WPF app (I guess they call it "classic desktop"). 我正在重用以前在常规Windows WPF应用程序上使用过的一些代码(我想他们称之为“经典桌面”)。 Trying to use a dockpanel, I get the error: 尝试使用底座面板时,出现错误:

Unknown type 'DockPanel' in XML namespace ' http://schemas.microsoft.com/winfx/2006/xaml/presentation ' XML名称空间' http://schemas.microsoft.com/winfx/2006/xaml/presentation '中的未知类型'DockPanel'

Searching online for "unknown type "dockpanel: in xml namespace +iot" returns zero results. In general I haven't had much success at finding sample UW/IOT core applications out there to learn from. 在网上搜索“未知类型” dockpanel:在xml名称空间中+ iot”返回零结果。总的来说,我在寻找示例性的UW / IOT核心应用程序方面没有什么成功。

Is this not available in Universal Windows? 这在通用Windows中不可用吗? Or am I missing some prerequisite? 还是我缺少一些先决条件?

Here's the code: 这是代码:

    <Grid Margin="5" DataContext="{Binding ElementName=me}">
    <Rectangle x:Name="backgroundRect" Fill="LightGray" Stroke="DarkGray" StrokeThickness="2" RadiusX="5" RadiusY="5" />
    <DockPanel LastChildFill="True" Margin="5">

DockPanel is only avaiable in WPF. DockPanel仅在WPF中可用。 See this link . 看到这个链接

Depends on the layout you want to achieve, but you can use a Grid as a replacement: 取决于您要实现的布局,但是您可以使用网格作为替换:

  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="Auto" />

      <!-- Fill up remaining space -->
      <ColumnDefinition Width="*" /> 
    </Grid.ColumnDefinitions>

    <TextBlock Grid.Column="0" Text="Stuff" />
    <ContentControl Grid.Column="1" />
  </Grid>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM