Click here to Skip to main content
15,905,785 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to create some custom controls in windows8.1 and also add some validation to it. I would like keep this validations as separate part and apply that to each the custom control. Is it possible to do this.Can any suggest a way to achieve this.

Thanking you,
CGN
Posted
Comments
Sergey Alexandrovich Kryukov 26-Mar-14 15:30pm    
The request is too vague, related to something very usual. The answer? Yes, it is of course possible. It's not clear what help you may need. Just design and implement it the way you want. I cannot see any concerns here.
—SA
CGN007 26-Mar-14 16:32pm    
I need to display a validation text and another notification text in each custom control.
In a normal way i can include this all in the custom control inside the generic.xaml.My question:: is it possible to separate that code in a common place and refer inside each custom control. Or can i inherit and use the code in the generic.xaml.
Sergey Alexandrovich Kryukov 26-Mar-14 16:45pm    
Inheritance and separation aren't alternative. You can do both. The problem seems artificial to me. I cannot imagine what are you missing. Are you familiar with development of control classes in general? If you develop a control, you can put it in the library you want. You can nest control if the parent control is designed to have some settable content inside it. Both controls should be independent, otherwise it would defeat their purpose...
—SA
CGN007 26-Mar-14 17:40pm    
Sorry..I'm talking about Templated control in windows8.1. I've already created them and successfully running in the app.but as part of code review i need to separate the validation control in common place.It will be great if i can do that way.. –
Sergey Alexandrovich Kryukov 26-Mar-14 17:48pm    
Perhaps you need to explain the problem in detail, with some source code sample...
—SA

1 solution

Just quick search provided me this
http://blogs.msdn.com/b/windowsappdev/archive/2012/10/15/building-a-custom-control-using-xaml-and-c.aspx[^]
SQL
Reusing controls
When you only want to use a control in a single project or for your own personal use, there isn’t much to think about in terms of packaging and distribution. But if you want to build a reusable control to share with other developers, you have some options. One option is to create a Visual Studio Extension SDK that other developers can install on their machines and add to their projects. For more info on how to do this, check out Creating an SDK using C# or Visual Basic.

http://msdn.microsoft.com/en-US/library/jj127119.aspx[^
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900