Use TargetType as third party control in wpf

162 Views Asked by At

I am using Mahapps.Metro UI for my WPF application. I want to modify Tile control provided by Mahapps to meet my needs. So I decided to make ControlTemplate for it. but I am unable to refer to TargetType as Tile control which is third party control. Can you help me with this?

1

There are 1 best solutions below

0
On BEST ANSWER

1) First you need to refer their assembly in your project. 2) You need to include the xaml namespace in the root(Window, ResourceDictionary or wherever you want to write template)

like ,

xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"

then use the type in your Template

<ControlTemplate TargetType={x:Type controls:TileControl}>
   <!--your template-->
</ControlTemplate >