Xaml Silverlight AG_E_Unknown_错误UserControl Apps.xml模板
我创建了一个简单的用户控件,即使应用程序运行正常,也可以将模板应用到 我在这里定义控件模板 App.xamlXaml Silverlight AG_E_Unknown_错误UserControl Apps.xml模板,xaml,templates,silverlight,user-controls,Xaml,Templates,Silverlight,User Controls,我创建了一个简单的用户控件,即使应用程序运行正常,也可以将模板应用到 我在这里定义控件模板 App.xaml <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="ResourcesCountDown.App
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ResourcesCountDown.App"
>
<Application.Resources>
<ControlTemplate x:Key="myWindowTemplate">
<Grid x:Name="myGrid" Background="Black" Width="50" Height="50">
<ContentPresenter Name="Content"></ContentPresenter>
</Grid>
</ControlTemplate>
</Application.Resources>
</Application>
我想您的
上需要一个TargetType=“Grid”:
<ControlTemplate x:Key="myWindowTemplate TargetType="Grid">
我想您的上需要一个TargetType=“Grid”:
<ControlTemplate x:Key="myWindowTemplate TargetType="Grid">
实际上,根据您发布的代码,您的TargetType应该是Button,因为您正在将模板应用于Button。实际上,根据您发布的代码,您的TargetType应该是Button,因为您正在将模板应用于Button
<ControlTemplate x:Key="myWindowTemplate TargetType="Grid">