Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - WPF user controls without XAML

 
 
Old 03-31-2007   #1 (permalink)
Cairn


 
 

WPF user controls without XAML

Does anybody know of any samples of creating and then using a WPF based user
control that does not required the use of the XAML files. The control I am
attempting to write, is too use DrawingVisuals as its for drawing some
mapping data which will contain a large number of shape objects. I have
attempted to create a control but cannot find a way of refering to it in a
WPF application, if i create an programatic instace is never displayed. All
the publications I have fond to date alays seem to use the XAML way of
programming, and donot seem to cater for large dynamic graphic controls which
wouled be butter severed with c# code.

Thansk in advance.

My System SpecsSystem Spec
Old 04-05-2007   #2 (permalink)
Bryan Phillips


 
 

Re: WPF user controls without XAML

Why not just use dynamic XAML?

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"Cairn" <Cairn@discussions.microsoft.com> wrote in message
news:3DAED165-4240-45EE-8A4C-7A78033C9B79@microsoft.com:

> Does anybody know of any samples of creating and then using a WPF based user
> control that does not required the use of the XAML files. The control I am
> attempting to write, is too use DrawingVisuals as its for drawing some
> mapping data which will contain a large number of shape objects. I have
> attempted to create a control but cannot find a way of refering to it in a
> WPF application, if i create an programatic instace is never displayed. All
> the publications I have fond to date alays seem to use the XAML way of
> programming, and donot seem to cater for large dynamic graphic controls which
> wouled be butter severed with c# code.
>
> Thansk in advance.


My System SpecsSystem Spec
Old 04-12-2007   #3 (permalink)
Matthew MacDonald [MVP]


 
 

RE: WPF user controls without XAML

You have a couple of options for custom drawing, but neither of them involves
user controls.

You can can derive from FrameworkElement, override OnRender(), and do your
drawing there. Or, you can derive from a class like Panel and add your
visuals using AddVisualChild() and AddLogicalChild(). Just remember to
override VisualChildrenCount and GetVisual().

M@

> Does anybody know of any samples of creating and then using a WPF based user
> control that does not required the use of the XAML files. The control I am
> attempting to write, is too use DrawingVisuals as its for drawing some
> mapping data which will contain a large number of shape objects. I have
> attempted to create a control but cannot find a way of refering to it in a
> WPF application, if i create an programatic instace is never displayed. All
> the publications I have fond to date alays seem to use the XAML way of
> programming, and donot seem to cater for large dynamic graphic controls which
> wouled be butter severed with c# code.
>
> Thansk in advance.

My System SpecsSystem Spec
 

Thread Tools



Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46