Open Awesomer9561 opened 2 years ago
Can you try to define the Convertes in the ContentPage
resource instead?
<ContentPage.Resources>
<converters:UnixDoubleHoursToTimeSpanConverter x:Key="UnixDoubleHoursToTimeSpanConverter" />
</ContentPage.Resources>
Then, bind the property like this.
Text="{Binding RemainingPrintTime, Converter={StaticResource UnixDoubleHoursToTimeSpanConverter}}"
I do this way and have no problems with Converters
.
Can you try to define the Convertes in the
ContentPage
resource instead?<ContentPage.Resources> <converters:UnixDoubleHoursToTimeSpanConverter x:Key="UnixDoubleHoursToTimeSpanConverter" /> </ContentPage.Resources>
Then, bind the property like this.
Text="{Binding RemainingPrintTime, Converter={StaticResource UnixDoubleHoursToTimeSpanConverter}}"
I do this way and have no problems with
Converters
.
That is working fine but passing parameters is an issue.
You can define the Paramters in here.
<ContentPage.Resources>
<converters:TypedBoolConverters x:Key="FirstConverter" TrueObject="{StaticResource Purple}" FalseObject="{StaticResource FadedGreen}" />
<converters:TypedBoolConverters x:Key="SecondConverter" TrueObject="{StaticResource White}" FalseObject="{StaticResource Purple}" />
</ContentPage.Resources>
This, however needs you to create a Resource for each parameter pair. But it would be a workaround for your issue atm.
You can define the Paramters in here.
<ContentPage.Resources> <converters:TypedBoolConverters x:Key="FirstConverter" TrueObject="{StaticResource Purple}" FalseObject="{StaticResource FadedGreen}" /> <converters:TypedBoolConverters x:Key="SecondConverter" TrueObject="{StaticResource White}" FalseObject="{StaticResource Purple}" /> </ContentPage.Resources>
This, however needs you to create a Resource for each parameter pair. But it would be a workaround for your issue atm.
But I want to bind properties from ViewModel not StaticResources
@StephaneDelcroix I think the parameter never supported data binding and one should use a MultiBinding
correct?
This is hell, wasted my two day without solution, cant bind with data and value converter, basically i hate android , who the hell developed this pathetic OS who is resource hungry, Microsoft could have invested in making windows apps for windows phone than supporting development of this pathetic android OS
Description
Hi, I am trying to bind a background color using converter and converter parameter but I am not able to pass ViewModel objects as parameters. Any ideas?
Steps to Reproduce
Version with bug
6.0.400 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
iOS 15, Android API 30, 31
Did you find any workaround?
No response
Relevant log output
No response