-
Notifications
You must be signed in to change notification settings - Fork 882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextBlockEditor : Use Label instead of TextBlock to allow customizing template #1539
Comments
Created pull request #1540 for this issue. |
Hi, A user then simply needs to do this in is xaml in order to modify the style: This will be fixed in v3.9. |
True . However, that only solves a part of problem..I was trying to give property grid a custom look to match my application theme and i wanted to have a border around TextBlock with border thickness : (0,0,0,1) . However, i can't do this if TextBlock is used to display property. |
Hi, If you don't know which properties are readonly, you can do the same in code-behind: <xctk:PropertyGrid SelectedObject="{Binding}"
|
Thanks @XceedBoucherS ....I believe the code behind approach should work fine..Wondering , however, whether propertyGrid.EditorDefintions is cleared every time the selected object changes ? Otherwise, there might be a possibility if there is some property X in type A which is readonly and EditorDefintion is now added to propertyGrid and then we try to set type B having property X as well but not marked as readonly , in this case B.X will also be rendered in a readonly mode. |
Hi, What I would suggest, is to register to the PropertyGrid.SelectedObjectChanged event and use the callback to clear the EditorDefinitions collection: You can also use the PreparePropertyItem callback to set the PropertyItem.Editor. It shouldn't affect the performance since all PropertyItems will end up with an Editor (either set by the user or the Default PropertyGrid editors). |
Thanks for sharing !! Appreciate your time !! I should be able to get my stuff working with this information. I will close the issue. |
Issue Description
TextBlockEditor : TypeEditor<TextBlock>
is used in PropertyGrid for displaying readonly properties.However, TextBlock control in WPF doesn't allow to override it's Template using a style.
Suggested Solution
Use a Label control instead of TextBlock control for displaying readonly properties since WPF Label control allows overriding it's control template using a style.
The text was updated successfully, but these errors were encountered: