Hello,
I have created a custom control Library called
Base_Dialog
and I built in
Base_Dialog
---
BaseDlg
like this:
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;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Base_Dialog
{
public class BaseDlg : Window
{
static BaseDlg()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(BaseDlg), new FrameworkPropertyMetadata(typeof(BaseDlg)));
}
}
}
and in
Generic.xaml
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Base_Dialog"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<Style TargetType="{x:Type local:BaseDlg}" >
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:BaseDlg}">
<Grid Background="Salmon">
<TextBlock Text="kdjdfg"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
and I wrote the following code in the
AssemblyInfo.cs
file:
<br />
[assembly: XmlnsDefinition("http://schemas.sheva.com/winfx/2006/xaml/presentation", "Base_Dialog")]
then open wpfapplication name((wpf))and add references Project ((Base_Dialog))
xaml code is:
<local:BaseDlg x:Class="wpf.Box"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="http://schemas.sheva.com/winfx/2006/xaml/presentation"
Title="Box" Height="300" Width="300">
<Grid>
<Button Content="enas" Height="30" Width="30" HorizontalAlignment="Left" VerticalAlignment="Top"/>
</Grid>
</local:BaseDlg>
I have created a grid in
BaseDlg
the
Box.xaml
change style but when I create a button in
Box.xaml
the
Box.xaml
has not changed.
The Box.xaml just content Textblock from BaseDlg
Any help is greatly appreciated.
Thanks.