ghost1372 / HandyControls

Contains some simple and commonly used WPF controls based on HandyControl
https://ghost1372.github.io/
MIT License
1.1k stars 104 forks source link

Come across InvalidOperationException When setting the uri of Imageselector #132

Closed IShiraiKurokoI closed 2 years ago

IShiraiKurokoI commented 2 years ago

Describe the bug Come across InvalidOperationException When setting the uri of Imageselector

To Reproduce if (File.Exists(Properties.Settings.Default.str1)) { pictureBox1.Uri = new Uri(Properties.Settings.Default.str1); }

picturebox1 is the name of a imageselector

Expected behavior System.InvalidOperationException:““Uri”属性注册为只读属性,不使用身份验证密钥则无法修改。” System.InvalidOperationException:“the 'URI' property is registered as a read-only property and cannot be modified without an authentication key.”

Screenshots image

Environment (please complete the following information):

IShiraiKurokoI commented 2 years ago

I solve the fuction I want by setting the background to a imagebrush and set it null in imageselected, but I still think the uri{get;set} should be able to be set in the backend

ghost1372 commented 2 years ago

https://github.com/ghost1372/HandyControls/issues/48