object obItem=this.FindResource("canvasdt"); if (obItem is System.Windows.DataTemplate) { System.Windows.DataTemplate getDtemplate = obItem as System.Windows.DataTemplate; if (getDtemplate.LoadContent() is Border) { Border b = getDtemplate.LoadC…
原文:WPF中动态加载XAML中的控件 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; usin…