-
Notifications
You must be signed in to change notification settings - Fork 698
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
XamlUICommand IconSource doesn't bind to button #4517
Comments
Original comment #4074 (comment) |
@brechtb86 does using x:Bind instead work? |
@StephenLPeters I thought that x:Bind only binds to dependency properties on the Page/UserControl code-behind. As you can see on this screenshot: |
@StephenLPeters I added an x:Bind in my Xaml and a XamlUICommand in the codebehind of that page just to see if it works to my sample project, and this doesn't work either. I prefer to use MVVM so that is why my example only bound to my viewmodel. Page.xaml
Page.cs
|
I updated the project to Project Reunion 0.8. Problem still remains, anyone any thoughts? |
This repros on UWP XAML, so this isn't a WinUI3 issue. It doesn't have anything to do with binding either. Note that this doesn't work: <Button>
<Button.Command>
<XamlUICommand Label="Pick folder" Description="Select a movie folder to add...">
<XamlUICommand.IconSource>
<SymbolIconSource Symbol="Folder"/>
</XamlUICommand.IconSource>
</XamlUICommand>
</Button.Command>
</Button> Nor does this: <Button x:Name="_myButton"/> public MainPage()
{
this.InitializeComponent();
_myButton.Command = new XamlUICommand
{
Description = "My description",
IconSource = new SymbolIconSource
{
Symbol = Symbol.Folder
}
};
} The example you have above that does work isn't using a Command at all. It's providing an This is actually a feature request for the |
I think we could do something like, check if the content property of the button is unset, if so, check the command propertly for an icon source. However this change would require system xaml changes which wont be funded. App Bar button already does this, or you could hook up the properties yourself. |
Describe the bug
When using an
IconSource
in aXamlUICommand
bound to aButton
then the icon is not visible.Steps to reproduce the bug
XamlUICommand
with anIconSource
to a button. The icon isn't visible.Expected behavior
The icon should be visible.
Screenshots
Version info
Nuget package version: [WinUI 3 - Project Reunion 0.5 Preview: 0.5.0-prerelease]
Windows app type
Code
A small project can be found in my repository: https://github.com/brechtb86/microsoft-ui-xaml-issues
XamlCommandBindingIconSourceIssuePage.xaml:
XamlCommandBindingIconSourceIssueViewModel:
The text was updated successfully, but these errors were encountered: