Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How xaml work when a ContentTemplate's Content is FrameworkElement but VistualTree is FrameworkElementFactory

$
0
0

A ContentTemplate:

<ControlTemplate TargetType="{x:Type XXX}"><Border /></ControlTemplate>

ControlTemplate inherit FrameworkTemplate

A part of code of FrameworkTemplate:

[ContentProperty("VisualTree")]
public class FrameworkTemplate
{
  public FrameworkElementFactory VisualTree { get; set; }
}

The VisaulTree property is FrameworkElementFactory.

But in the xaml file, it is a FrameworkElement in ContentTemplate.

How does it work? I want to create a similar class.


QQ247695480


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>