Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

It looks like mvx:Bi.nd in combination with InvertedVisibility is broken in 9.2 #4749

Closed
Joost-Jens-Luminis opened this issue Nov 1, 2023 · 3 comments
Labels
t/bug Bug type

Comments

@Joost-Jens-Luminis
Copy link
Contributor

Joost-Jens-Luminis commented Nov 1, 2023

馃敊 Regression

Old (and correct) behavior

We have an border that we want to show when a boolean value is false.
Before we used mvx:Bi.nd="Visibility InvertedVisibility(ScrollDownHintVisible)" (form mvvmcross.plugin.visibility) on the element like so:
<Border mvx:Bi.nd="Visibility InvertedVisibility(ScrollDownHintVisible)" Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="44" Height="44" Margin="24,0" CornerRadius="5, 5, 0, 0" Background="{StaticResource IndustrialLiquidBlue}"> <FontIcon x:Name="Chevron" Foreground="White" Glyph="&#xe92e;"/> </Border>

However, while the ScrollDownHintVisible property is false, the border (with fonticon in it) is expected to be visible.

Current behavior

However, currently this border is actually not visible until ScrollDownHintVisible becomes true.
If however we use the following instead it does work as expected:
Visibility="{Binding ScrollDownHintVisible, Converter={StaticResource InvertedVisibilityConverter}}"

It does work. (this uses a local version of the InvertedVisibilityConverter which is setup as follows:
public class InvertedVisibilityConverter : MvxNativeValueConverter<MvxInvertedVisibilityValueConverter> { }

Reproduction steps

Have a border with mvx:Bi.nd on the visibility and the invertedVisibilityConverter

Further details

The InvertedVisibilityConverter has been added in the Setup as follows:
protected override void FillValueConverters(IMvxValueConverterRegistry registry) { base.FillValueConverters(registry); registry.AddOrOverwriteFrom(typeof(MvxInvertedVisibilityValueConverter).Assembly); }

This doesn't seem to have any effect though.

Configuration

Version:
MvvmCross 9.2.0-beta.3
MvvmCross.Plugin.Visibility 9.2.0-beta.3

Platform:

  • WinUI
  • .Net 8.0 RC2
@Joost-Jens-Luminis Joost-Jens-Luminis added the t/bug Bug type label Nov 1, 2023
@Cheesebaron
Copy link
Member

Does it work if you override LoadPlugins like so:

    public override void LoadPlugins(IMvxPluginManager pluginManager)
    {
        base.LoadPlugins(pluginManager);
        pluginManager.EnsurePluginLoaded<MvvmCross.Plugin.Visibility.Platforms.Android.Plugin>();
    }

@Joost-Jens-Luminis
Copy link
Contributor Author

Joost-Jens-Luminis commented Nov 1, 2023

We already have that in place (the WinUI version of course):

        public override void LoadPlugins(IMvxPluginManager pluginManager)
        {
            pluginManager.EnsurePluginLoaded<MvvmCross.Plugin.Messenger.Plugin>();
            pluginManager.EnsurePluginLoaded<MvvmCross.Plugin.Visibility.Platforms.WinUi.Plugin>();
            pluginManager.EnsurePluginLoaded<MvvmCross.Plugin.Color.Platforms.WinUi.Plugin>();
            base.LoadPlugins(pluginManager);
        }

Edit: Formatting and language :)

@Joost-Jens-Luminis
Copy link
Contributor Author

This works again in the latest beta. Closing this ticket now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Bug type
Development

No branches or pull requests

2 participants