简体   繁体   中英

Is DockPanel not available in Windows IOT Core

I'm trying to make my first Universal Windows app for Windows IOT Core. I'm reusing some code that I had previously used on a regular Windows WPF app (I guess they call it "classic desktop"). Trying to use a dockpanel, I get the error:

Unknown type 'DockPanel' in XML namespace ' http://schemas.microsoft.com/winfx/2006/xaml/presentation '

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.

Is this not available in Universal 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. 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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