Programmer001
Programmer001

Reputation: 21

Text color value depending on the background color through Converter in MAUI .net

I have used converter in MAUI .net and on the basis of cost of toy I have changed the background color i.e.

<Frame x:Name="FrameToy" Grid.Column="0" Grid.Row="0">
<Frame.BackgroundColor>
    <MultiBinding Converter="{StaticResource ToyColorConverter}">
        <Binding Path="ToyName" />
    </MultiBinding>
</Frame.BackgroundColor>
</Frame>

Now on the basis of this color I want to change Text color so that it will be displayed on the dark background. I have tried the following but not able to accomplish that:

<Label Text="{Binding Supplier}">
          <Label.TextColor>
              <MultiBinding Converter="{StaticResource TextColorCoverterVdBackground}">
                  <Binding Path="{x:Reference FrameToy},Path=BackgroundColor" />
              </MultiBinding>
          </Label.TextColor>
</Label>

Any help will be appreciated. Thank you.

Upvotes: 0

Views: 96

Answers (0)

Related Questions