Category Archives: WPF

WPF – equivalent of xx.Controls.Find(controlName,true)

In Windows application, you can find a child control by its name ascustomControl.Controls.Find(controlName, true); The same functionality can be achieved in WPF by usingcustomControl.FindName(controlName); If it is in a different threadobject result;customControl.Dispatcher.Invoke(DispatcherPriority.Normal,new Action(delegate(){result = customControl.FindName(controlName);}));

Posted in WPF | Leave a comment

WPF – The calling thread cannot access this object because a different thread owns it

We can’t update the WPF UI components from a thread, that is not owning the UI Component. When we try to update any UI elements from another thread, we will get the exception “The calling thread cannot access this object … Continue reading

Posted in WPF | 4 Comments

Binding WPF DataContext to Dictionary

Created one custom WPF control with a textbox. We can bind the custom WPF control to data in different ways. Bind Using Class Object Xaml Code Behind 1. Create object of the class Address likeAddress add=new Address(){Street=”Hyderabad Eat Street”};2. Assign … Continue reading

Posted in WPF | Leave a comment

WPF: The tag XXX does not exist in XML namespace ‘clr-namespace:YYY’

When I used the custom WPF control in my project , I got the following compilation error The tag ‘TestCtrl’ does not exist in XML namespace ‘clr-namespace:MceWpfContainer;assembly=MceWpfContainer’. Following solution fixed my WPF custom control issue.Solution: 1. Open the Project properties. … Continue reading

Posted in WPF | 3 Comments