Select to view content in your preferred language

Apply validation in addin dock pane using wpf by arc pro sdk

879
2
Jump to solution
02-10-2022 07:52 AM
AbdelrahmnanMohamed
New Contributor

I am a developer making a custom tool, my tool has 2 text boxes, I want to make both of them required and mandatory to be not empty and I want also to make a red star (*) above them as they made in esri geo processing tools, any idea for that please??

0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi, 

You should implement the INotifyDataErrorInfo interface in your view model class. Please refer to

https://social.technet.microsoft.com/wiki/contents/articles/19490.wpf-4-5-validating-data-in-using-t... for more information and examples.

For red star (*) you should make 2 texbox'es inside grid or stackpanel. One of them preset text "*" and make Foreground = "red". Second textbox will show field label with esri style. 

If you want to make universal dialog for different database table records you should bind "*" textbox visibility to database field property. 

View solution in original post

2 Replies
GKmieliauskas
Esri Regular Contributor

Hi, 

You should implement the INotifyDataErrorInfo interface in your view model class. Please refer to

https://social.technet.microsoft.com/wiki/contents/articles/19490.wpf-4-5-validating-data-in-using-t... for more information and examples.

For red star (*) you should make 2 texbox'es inside grid or stackpanel. One of them preset text "*" and make Foreground = "red". Second textbox will show field label with esri style. 

If you want to make universal dialog for different database table records you should bind "*" textbox visibility to database field property. 

AbdelrahmnanMohamed
New Contributor

Thank you so much it solves my problem 

0 Kudos