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

Disable state selected in InRibbonGallery after click #593

Closed
balkarov opened this issue Jul 26, 2018 · 17 comments
Closed

Disable state selected in InRibbonGallery after click #593

balkarov opened this issue Jul 26, 2018 · 17 comments
Assignees
Labels
Milestone

Comments

@balkarov
Copy link

balkarov commented Jul 26, 2018

Hello. Thank you for your library!
Is it possible disable state selected GalleryItem in InRibbonGallery after click on Item as like button?

default

And after click panel change alpha. Is it possible disable too?
sdfsdf

My code:

<fluent:InRibbonGallery ItemHeight="55"
                        ItemWidth="80"
                        ItemsSource="{Binding SomeList}">
    <fluent:InRibbonGallery.ItemTemplate>
        <DataTemplate>
            <fluent:GalleryItem Tag="{Binding DisplayName}">
                <StackPanel>
                    <Image Source="{Binding ImageUri}"/>
                    <TextBlock Text="{Binding DisplayName}"/>
                </StackPanel>
            </fluent:GalleryItem>
        </DataTemplate>
    </fluent:InRibbonGallery.ItemTemplate>
</fluent:InRibbonGallery>

Sorry I did not find solution.
Thank you!


Environment

  • Fluent.Ribbon 6.1.0.233
  • Windows 10
  • .NET Framework 4.6.2
@batzen
Copy link
Member

batzen commented Jul 26, 2018

GalleryItems are meant to be selected and not work as regular buttons.
You could try to set IsSelected=false or add a click event handler and reset the selection from there.

I am not sure if i fully understood your question however.

@batzen batzen added the Question ❓ Not an issue but a question instead. label Jul 26, 2018
@balkarov
Copy link
Author

balkarov commented Jul 26, 2018

Hm... maybe you have idea?
Look. I want group dinamic elements (40-50 elements) on the Ribbon. And group it. Show max 7 elements in Rows and in Dropdown show all elements. But I want this elements work as like buttons after click. Click and remove background selected.

I try override fluent GalleryItem

protected override void OnClick(object sender, RoutedEventArgs e)
        {
            base.OnClick(sender, e);
            ((GalleryItem) sender).IsSelected = false;
        }

But it works not fully. Because sometimes fluent:InRibbonGallery still leave selected item.

I try use Button instead GalleryItem but still fluent:InRibbonGallery leave selected item after click.

@balkarov
Copy link
Author

balkarov commented Jul 26, 2018

If you open outlook you can see what I want (Quick Steps) (but with big image)
This is Gallery too, but all items work as like buttons (after click item unselected)
outlook-quick-step

@batzen
Copy link
Member

batzen commented Jul 26, 2018

If it's something outlook offers as a feature i will add this feature here too.

@balkarov
Copy link
Author

balkarov commented Jul 26, 2018

Thanks a lot! I will wait

@batzen batzen added Feature 🥇 and removed Question ❓ Not an issue but a question instead. labels Jul 26, 2018
@batzen batzen self-assigned this Jul 26, 2018
@batzen
Copy link
Member

batzen commented Aug 5, 2018

Just noticed that this should already be possible.
Could you try to set Selectable on your InRibbonGallery?

@balkarov
Copy link
Author

balkarov commented Aug 6, 2018

Selectable (False/True) does not help.
After click item state is selected

Version 6.1.0.233

@batzen batzen added this to the 7.0.0 milestone Aug 6, 2018
@batzen
Copy link
Member

batzen commented Aug 6, 2018

It's broken. Will fix it.

@batzen batzen closed this as completed in afd8e2f Aug 8, 2018
@balkarov
Copy link
Author

Hello. Did you fix this problem?

@balkarov
Copy link
Author

balkarov commented Apr 23, 2019

I tried to install 7.0.0-alpha0624 but it does not work.
I mean Selectable on InRibbonGallery

@batzen
Copy link
Member

batzen commented Apr 27, 2019

It's working in the showcase application.
Could you create a small repro project which showcases your issue?

@balkarov
Copy link
Author

@batzen this is my small project
WpfApp2_gallery.zip

Result is

image

I use GalleryItem in DataTemplate of InRibbonGallery. I think in this problem. But I need Command when click GalleryItem

@batzen
Copy link
Member

batzen commented May 3, 2019

By using a DataTemplate you are generating a GalleryItem inside a GalleryItem.
If you don't want that to happen you should use ItemContainerStyle for your command and command parameter and use a grid/stackpanel etc. as the item template.

I have also run into this issue a few times, but it's the default WPF behavior and i can't do much about it.

@balkarov
Copy link
Author

balkarov commented May 4, 2019

Could you send me example how use InRibbonGallery with command by click?

@batzen
Copy link
Member

batzen commented May 4, 2019

Will do so after my vacation. Please ping me here if i didn't send you an example by may 14th.

@balkarov
Copy link
Author

balkarov commented May 4, 2019

Ok, thank you! I will. Have a good time!

@batzen
Copy link
Member

batzen commented May 13, 2019

You could use something like this:

<Fluent:InRibbonGallery.ItemContainerStyle>
    <Style TargetType="{x:Type Fluent:GalleryItem}">
        <Setter Property="Command"
                Value="{Binding MyCommand}" />
    </Style>
</Fluent:InRibbonGallery.ItemContainerStyle>

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

No branches or pull requests

2 participants