PC Review


Reply
Thread Tools Rate Thread

Adding extended components using XAML

 
 
K Viltersten
Guest
Posts: n/a
 
      11th Oct 2008
I've designed a class MyButton, extending
Button class. I want to use
<MyButton Name="name">text</MyButton>
instead of
<Button Name="name">text</Button>
but the compiler nags about the class not
being a part of the namespace.

How do i add/set the namespace (Test01) to
be valid for my XAML-setup?

--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy

 
Reply With Quote
 
 
 
 
K Viltersten
Guest
Posts: n/a
 
      12th Oct 2008
> In the object "Window" add this parameter:
>
> xmlns:test="clr-namespace:xxx;assembly=yyy"
>
> Change the xxx for the namespace of your control
> and yyy with the assembly name, or use
> xmlns:zzz="clr-namespace:xxx"
> if your control is in the same assembly. After
> this you can add your control with this code:
> <test:MyButton Name="name">text</test:MyButton>
> You can change the prefix "test" for something
> else, like "local". The final code looks like
> this:
> <Window x:Class="WpfApplication1.Window1"
> xmlns =
> "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
> xmlns:test="clr-namespace:xxx">
> <test:MyButton Name="name">text</test:MyButton>
> </Window>


Ah, thanks!

--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding XAML/Spry to a Webpage? ross m. greenberg Windows Vista General Discussion 0 18th Dec 2009 02:07 AM
Is it possible to include XAML files into another XAML file? star-italia Microsoft Dot NET 4 12th Jun 2008 10:56 AM
XAML: How to dispay External XAML grid Chris Moore Microsoft Dot NET Framework 0 10th Nov 2006 09:26 PM
Adding extended file info to photo (JPEG) files Newsgroups Windows XP Photos 0 7th Jan 2004 10:42 PM
Adding Components Diane Microsoft Outlook Installation 0 1st Jul 2003 06:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 AM.