IconElement implementation#543
Conversation
|
@pomianowski I hope you haven't forgotten about this interesting pull-request. |
There was a problem hiding this comment.
Hey @IvanDmitriev1 thank you again for your huge contribution and effort. You did a great job modifying the icons by the way changing strong dependencies on specific classes. Apart from a few minor things, the code looks fine to me.
However, looking at your recent changes, I think it's probably better to put all the control-related classes in one Controls directory. It may be a lot stuff in one place, but I think it will be easier for the end user to use, similar to what is done in WPF.
As for presenting icons, I think ContentPresenter is a better than ContentControl for that.
<ContentPresenter
x:Name="ControlIconLeft"
Grid.Column="0"
Margin="{StaticResource TextBoxLeftIconMargin}"
VerticalAlignment="Top"
Content="{TemplateBinding Icon}"
Focusable="False"
TextElement.FontSize="16"
TextElement.Foreground="{TemplateBinding Foreground}"
Visibility="Visible" />Eventually, ContentControl uses ContentPresenter to present content, so we can consider ContentPresenter as more ligthweight
https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/Themes/XAML/ContentControl.xaml#LL17C21-L17C40
|
Implements a
IconElementcontrol almost like in winui 3.Replaces
SymbolIconwithIconElement.Pull request type
Other information