Reputation: 61341
In Windows Phone 7 Silverlight, is there a way to design a custom control from scratch - i. e. with custom drawing and custom touch processing? What do I subclass for that?
Upvotes: 1
Views: 498
Reputation: 16319
As mentioned, you can create a custom control from scratch by deriving from the Control
class. To implement gesture handling you can use the GestureService
from the Silverlight Toolkit for WIndows Phone 7 or you can directly handle the ManipulationStarted
, ManipulationDelta
, and ManipulationCompleted
UIElement
events.
Jeff Prosise has a great series of four posts that cover touch manipulation in great detail:
For the "custom drawing" part, what did you have in mind? If a control built up from primitives isn't what you had in mind, what about lines and shapes?
Upvotes: 1
Reputation: 1400
Yes you can. You usually subclass Control, ItemsControl, or ContentControl. Here is a blog post that explains the process in detail: Creating a WP7 Custom Control in 7 Steps
Upvotes: 7