-
Notifications
You must be signed in to change notification settings - Fork 30
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
[TextBox][WinUI] Failed to assign LeadingIcon #1286
Comments
winappsdk and sttached property..: <Setter Property="um:ControlExtensions.TrailingIcon" Value="{x:Null}" />
<Setter Property="local:ControlHelper.Asd" Value="Qwe" />
<Setter Property="local:ControlHelper.AsdIcon" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<StackPanel x:Name="Root">
<void:Border Tag="X" void:Visibility="{Binding Path=(um:ControlExtensions.TrailingIcon), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource MaterialNullToCollapsedConverter}, FallbackValue=Collapsed, TargetNullValue=Collapsed}">
<Button Content="{Binding Path=(um:ControlExtensions.TrailingIcon), RelativeSource={RelativeSource TemplatedParent}}"
void:Command="{Binding Path=(um:ControlExtensions.TrailingCommand), RelativeSource={RelativeSource TemplatedParent}}"
void:Visibility="{Binding Path=(um:ControlExtensions.IsTrailingIconVisible), RelativeSource={RelativeSource TemplatedParent}}"/>
</void:Border>
<void:ContentControl Tag="O" Content="{TemplateBinding um:ControlExtensions.TrailingIcon}" />
<void:ContentControl Tag="X" Content="{Binding Path=(um:ControlExtensions.TrailingIcon), RelativeSource={RelativeSource TemplatedParent}}" />
<void:ContentControl Tag="X" Content="{Binding Path=(um:ControlExtensions.TrailingIcon), RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<ContentControl Tag="O" Content="{TemplateBinding local:ControlHelper.Asd}" />
<ContentControl Tag="O" Content="{Binding Path=(local:ControlHelper.Asd), RelativeSource={RelativeSource TemplatedParent}}" />
<ContentControl Tag="O" Content="{Binding Path=(local:ControlHelper.Asd), RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<!-- note: both work, just not both at same time (since UIElement can nested under 1 parent at a time) -->
<!--<ContentControl Tag="O" Content="{TemplateBinding local:ControlHelper.AsdIcon}" />-->
<!--<ContentControl Tag="O" Content="{Binding Path=(local:ControlHelper.AsdIcon), RelativeSource={RelativeSource TemplatedParent}}" />-->
<Button Tag="O" Content="{TemplateBinding um:ControlExtensions.TrailingIcon}" />
<void:Button Tag="X" Content="{Binding Path=(um:ControlExtensions.TrailingIcon), RelativeSource={RelativeSource TemplatedParent}}" /> ^ for attached properties from local assemblies, binding and template-binding all work. |
good ole microsoft/microsoft-ui-xaml#6388 |
@jeromelaban |
Run the WinUI app using the native debugger, it may give you more information about the issue (make sure to be on 1.4 latest) |
I got the following , but I guess this doesn't offer much context: |
You'll need to look at the output window to get meaningful information. |
These are the last logs from the output before the app crashes. I couldn't find any relevant information from the output, but I am attaching it here so you guys can take a look. |
full stack trace
stack trace captured by the thrown exception
HResult = -2147467259 (0x80004005) // E_FAIL
|
@jeromelaban I don't see anything helpful in the stacktrace unless you see something? |
I'll take a look |
@Youssef1313 , here's a repro with the style/template that may facilitate the investigation... The style/template is basically a copy of the MaterialOutlinedTextBoxStyle defined in my branch (dev/ERLI/TextBox-Icons). cc @kazo0 |
I got nowhere investigating this 😕 |
based on my previous research: #1286 (comment)
|
Current behavior
Windows (WinUI) specific.
When setting LeadingIcon to TextBox the error "Failed to assign LeadingIcon" occurs.
Obs.: And even if LeadingIcon is not set an unhandled excpetion is thrown.
How to reproduce it (as minimally and precisely as possible)
Environment
Nuget Package:
Package Version(s):
Affected platform(s):
Anything else we need to know?
The text was updated successfully, but these errors were encountered: