Home > Blockchain >  Separator tag not found in UWP XAML
Separator tag not found in UWP XAML

Time:04-02

I think the title says it all. When I try to use the <Separator /> tag to put a line in between elements in a stack panel in a UWP XAML app, I get this:

When I hover over the separator elements it says that The type Separator cannot be found and gives the error code XLS0414.

Any ideas?

I've looked at many websites and they all say that I need to use the separator tag for what I'm trying to do, but I can't use it...

CodePudding user response:

There is no such thing as a Separator UIElement in UWP. Separator is a WPF construct, so if you're looking at many websites that all say you need to use the separator flag, they're probably referring to a WPF application or using some toolkit nuget package.

However, you can mimic a Separator using a couple of workarounds.

  1. Use a Border that has a thickness defined on only one edge.
<Border BorderThickness="0,1,0,0" ... />
  1. Use a Rectangle that is shaped like a separator
<Rectangle HorizontalAlignment="Stretch" Height="1" Fill="Black" />
  • Related