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

Suggestion: Change isdragging opacity to animation #56

Open
mrfrostfire opened this issue Nov 2, 2015 · 4 comments
Open

Suggestion: Change isdragging opacity to animation #56

mrfrostfire opened this issue Nov 2, 2015 · 4 comments

Comments

@mrfrostfire
Copy link

mrfrostfire commented Nov 2, 2015

This is not really an issue but a suggestion.
Currently the opacity is changed on dragging of tabs to .95 on the tab dragged and .5 on the siblings.
This causes the tabs to "blink" when clicking on them to change tab.
To avoid this blinking effect, you can set the opacity as an animation instead with ie a duration of 0:0:.2 and begintime to 0:0:0.1.
This removes the blinkeffect and gives it a subtle opacityanimation.

Here's the code I use:
<Style.Resources> <Storyboard x:Key="IsDraggingSB"> <DoubleAnimation Storyboard.TargetProperty="Opacity" To=".95" Duration="0:0:0.2" BeginTime="0:0:0.1"/> </Storyboard> <Storyboard x:Key="IsSiblingDraggingSB"> <DoubleAnimation Storyboard.TargetProperty="Opacity" To=".5" Duration="0:0:0.2" BeginTime="0:0:0.1"/> </Storyboard> </Style.Resources> <Style.Triggers> <Trigger Property="IsDragging" Value="True"> <Trigger.EnterActions> <BeginStoryboard Name="BeginIsDraggingSB" Storyboard="{StaticResource IsDraggingSB}"/> </Trigger.EnterActions> <Trigger.ExitActions> <RemoveStoryboard BeginStoryboardName="BeginIsDraggingSB"/> </Trigger.ExitActions> </Trigger> <Trigger Property="IsSiblingDragging" Value="True"> <Trigger.EnterActions> <BeginStoryboard Name="BeginIsSiblingDraggingSB" Storyboard="{StaticResource IsSiblingDraggingSB}"/> </Trigger.EnterActions> <Trigger.ExitActions> <RemoveStoryboard BeginStoryboardName="BeginIsSiblingDraggingSB"/> </Trigger.ExitActions> </Trigger>

@djengineerllc
Copy link

Stupid code inside github comments :(

I am unable to see your code that you use. Could you put it in http://pastebin.com/ and then provide a link by chance?

@YTsalko
Copy link

YTsalko commented Aug 8, 2016

Please, provide code. This blinking is really annoying.

@YTsalko
Copy link

YTsalko commented Aug 8, 2016

Ok, I managed this using next code (please notice that I used Dragablz with MaterialDesignInXamlToolkit)

<dragablz:TabablzControl>
    <dragablz:TabablzControl.ItemContainerStyle>
        <Style TargetType="{x:Type dragablz:DragablzItem}"
                   BasedOn="{StaticResource MaterialDesignDragableTabItemVerticalStyle}">
            <Style.Triggers>
                <Trigger Property="IsDragging" Value="True">
                    <Setter Property="Opacity" Value=".87" />
                </Trigger>
                <Trigger Property="IsSiblingDragging" Value="True">
                    <Setter Property="Opacity" Value=".95" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </dragablz:TabablzControl.ItemContainerStyle>
...
</dragablz:TabablzControl>

@mrfrostfire
Copy link
Author

mrfrostfire commented Aug 9, 2016

Sorry about the code, I never got any indication that this thread was responded to.
I updated the original post with the code made visible.
Hope it works this time :)

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

3 participants