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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BubblePopup compatibility with MVVM #37

Open
Estevete opened this issue Dec 18, 2019 · 5 comments
Open

BubblePopup compatibility with MVVM #37

Estevete opened this issue Dec 18, 2019 · 5 comments

Comments

@Estevete
Copy link

Is there a way to make BubblePopup compatible with MVVM?
In case of no, is it expected to have this feature available?

Maybe having the possibility of adding the BubblePopup through XAML would be a really good improvement.

@baskren
Copy link
Owner

baskren commented Dec 18, 2019

Depends on what you mean by both questions. I've done some examples of BubblePopups using XAML in the past ... I'll have to look for them once I'm done with my current todo list.

What do you mean by making BubblePopup comparable with MVVM? For example, is there something about the BindingContext that doesn't work as you would expect?

By the way, how did you get 4 emoji's on a 1 hour old posting?

@Estevete
Copy link
Author

For the compatibility of MVVM, I mean how to show a Bubble Popup from an ICommand in ViewModel of current view. (Button calls the command, and the command shows the bubble popup, without code behind).

The other question is to know the way to put the BubblePopup at XAML code (current view), and manage its visibility by binding IsVisible to ViewModel.

It would be nice if you can share those examples.

I got those emoji's because we are all working on the same project, and we are trying different controls that fill our needs, and this one looks like it does, but we do not want code behind.

@Estevete
Copy link
Author

Estevete commented Jan 7, 2020

Have you found any example?

@nitewulf
Copy link

@Estevete Did you come across anything else that filled your needs? My project has the exact same requirements it sounds like.

@smalgin
Copy link
Contributor

smalgin commented Jan 23, 2022

You are overthinking it. You can create BubblePopup and set its content from the existing view. Then you just set it to Visible state. As long as you use main thread to change visibility, you can call the function below from anywhere.

        private void ShowHelp()
        {
            var pb = new BubblePopup(targetVisualElement);
            var pv = new InfoPopupView(htmlText, pb); //my custom view with a F9P label & Ok/Cancel buttons that hide popup
            pb.Content = pv;

            Device.BeginInvokeOnMainThread(() =>
            {
                p.IsVisible = true;
            });
        }

The BIGGEST issue I had with the bubble popup is how hard it is to obtain targetVisualElement pointing to a UI widget INSIDE a ListView/CollectionView. But that's general design difficulty and has nothing to do with F9P.

Also sometimes BubblePopup loses pointer to visual element but I was unable to repro it outiside of my fairly complex app. So far I have two annoying cases: no pointer to grid at the top of the page, and no pointer to a button positioned by absolute layout.

I'll keep trying to make repro case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants