Hello,
I want to write an UserControl which is included XamTextEditor and Label. I put XamTextEditor in order to my Usercontrol and I try to wrap it's HorizontalContentAlignment property. For doing this I write a dependency property into my BTextEditorLabeled.xaml.cs file and bind it in BTextEditorLabled.xaml file to XamtextEditor. When I set the BTextEditorLabeled usercontrols HorizontalContentAlignment to HorizontalAlignment.Right, it raises invalid cast exception on runtime. I attached sample project file. İs it a bug ?
Hello okkesemin,
It has been a while since you have made your post, in case you still need of support I will be glad to assist you on the matter. I have been looking into your sample and I believe that the exception is rising because the two properties HorizontalContentAlignment are from different type. I can suggest you use Converter for the value you provide to XamTextEditor and convert the HorizontalAlignment.Right value to TextAlignment. Right value using class that inherits IValueConverter interface.
If you still need any assistance on this, please do not hesitate to ask.