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

PopupBox Implementation #101

Open
Tenjim opened this issue Aug 11, 2021 · 9 comments
Open

PopupBox Implementation #101

Tenjim opened this issue Aug 11, 2021 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@Tenjim
Copy link

Tenjim commented Aug 11, 2021

Hi guys,

Just a question, do you have any implementations of PopupBox from Material Design ?
I'm using it and I wanna to know if there is any implementations ingoing for material.avalonia ?

Thanks in advance.

@SKProCH
Copy link
Collaborator

SKProCH commented Aug 12, 2021

Hello, @Tenjim

If I understand you correctly, then what you want is implemented in DialogHost.Avalonia:
previewGif

Soon I think I'll be integrating this package into Material.Design, but for now it can be delivered and used separately.

Does this solve your problem?

@Tenjim
Copy link
Author

Tenjim commented Aug 12, 2021

Hi @SKProCH,

It's a button that open a content with others controls in it.
It's not a other window poping like DialogHost.

PopupBox

@SKProCH
Copy link
Collaborator

SKProCH commented Aug 12, 2021

@Tenjim, you can use, for example, ToggleButton and Popup controls like this:

<ToggleButton Name="MyToggleButton" HorizontalAlignment="Center">Toggle me</ToggleButton>
<Popup IsOpen="{Binding #MyToggleButton.IsChecked}"
       PlacementTarget="MyToggleButton"
       PlacementMode="Bottom">
  <styles:Card>
    <TextBlock>Your popup content here</TextBlock>
  </styles:Card>
</Popup>

Popup + ToggleButton

@Tenjim
Copy link
Author

Tenjim commented Aug 12, 2021

@SKProCH , Thank ! I'll try it to check if it complete my need :)

@Tenjim
Copy link
Author

Tenjim commented Aug 13, 2021

Hi @SKProCH,

Just to clarify what we need. It's a control from MaterialDesignInXamlToolkit. https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/wiki/PopupBox

@SKProCH
Copy link
Collaborator

SKProCH commented Aug 13, 2021

@Tenjim, We don't have one out of the box at the moment.

We will try to implement this control as early as possible, but I do not know when it will be, because the main team of contributors is currently busy at work.
If you want, then you can implement this (or something else) by yourself and create a PR. They are warmly welcomed.

@SKProCH SKProCH added enhancement New feature or request and removed waiting for feedback labels Aug 13, 2021
@SKProCH
Copy link
Collaborator

SKProCH commented Aug 14, 2021

@Tenjim, seems like this is already implemented via Menu control:
Анимация
Is this what you were looking for?

@Tenjim
Copy link
Author

Tenjim commented Aug 16, 2021

@SKProCH, not really because I want to put an usercontrol on the popup content like your first example.

I want to put a usercontrol which have many Buttons/ ComboBox/ CheckBox/... like into the Card

example :

<PopupBox  IsEnabled="True">
       <control: CustomUserControl>
</PopupBox>

CustomUserControl.axaml:

<StackPanel>
            <TextBlock x:Name="Label"
                       VerticalAlignment="Center"
                       Text="{Binding Label}">
            </TextBlock>
            <CheckBox 
                  IsChecked="{Binding IsCheck}"
                  Name="CheckBoxTest1"/>
</StackPanel>

It's what I want to do with PopupBox.

@Tenjim
Copy link
Author

Tenjim commented Aug 17, 2021

Hi @SKProCH,

Finally, I have done a workaround with your advice (Togglebutton with popup) :

<Style Selector="buttons|PopupBox">
      <Setter Property="Template">
        <ControlTemplate>
            <Grid>
                <ToggleButton Name="toggle" IsEnabled="True" HorizontalAlignment="Center" IsChecked="{Binding #StandardPop.IsOpen}">Click me</ToggleButton>
                <Popup x:Name="StandardPop" IsLightDismissEnabled="True"
                       HorizontalOffset="0"
                       VerticalOffset="10"
                       PlacementTarget="toggle"
                       IsOpen="{Binding #toggle.IsChecked}">
                    <styles:Card
                        Name="CardPopup"
                        FontSize="15"
                        FontWeight="Regular"
                        Padding="10"
                        Margin="5">
                        <ContentPresenter Content="{TemplateBinding Content}" />
                    </styles:Card>

                </Popup>
            </Grid>
        </ControlTemplate>
      </Setter>
  </Style>

Tenjim

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

No branches or pull requests

2 participants