Hello,
Is there possible way to add this?
Yes, you can add Converter directly by Binding.Converter
tag without using <toolkit:Popup.Resources>
like following code.
<toolkit:Popup xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
...
>
<VerticalStackLayout>
<Switch x:Name="switch2" />
<Label>
<Label.Text>
<Binding Source="{x:Reference switch2}"
Path="IsToggled">
<Binding.Converter>
<local:BoolToObjectConverter x:TypeArguments="x:String"
TrueObject="Yes"
FalseObject="No" />
</Binding.Converter>
</Binding>
</Label.Text>
<Label.TextColor>
<Binding Source="{x:Reference switch2}"
Path="IsToggled">
<Binding.Converter>
<local:BoolToObjectConverter x:TypeArguments="Color"
TrueObject="Green"
FalseObject="Red" />
</Binding.Converter>
</Binding>
</Label.TextColor>
</Label>
</VerticalStackLayout>
</toolkit:Popup>
Here is a document about Binding value converters - .NET MAUI | Microsoft Learn
If you want to add resources by toolkit:Popup.Resources
, please add feature request in MAUI community toolkit GitHub page.
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.