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

Replacing WindowChrome and related things with reference to ControlzEx #3021

Merged
merged 21 commits into from Aug 25, 2017

Conversation

Projects
None yet
3 participants
@batzen
Contributor

batzen commented Aug 16, 2017

Everything related to WindowChrome and it's associated Behavior is replaced with a reference to ControlzEx.

This also massively increases resize performance of the window.

@batzen

This comment has been minimized.

Contributor

batzen commented Aug 16, 2017

Don't know why the build fails.
Tried to reproduce by using a cleanly checked out version, compiled and ran tests. Everything worked fine.

@punker76

@batzen he Bastian, please look at my comments. if there any questions ping me at gitter

public class BorderlessWindowBehavior : WindowChromeBehavior

This comment has been minimized.

@punker76

punker76 Aug 21, 2017

Member

this should be marked as obsolete by using the new WindowChromeBehavior

This comment has been minimized.

@batzen

batzen Aug 22, 2017

Contributor

Why should this be marked obsolete?
Should we bind things like ResizeBorderThicknessProperty and GlowBrushProperty in InitializeStylizedBehaviors?

This comment has been minimized.

@punker76

punker76 Aug 22, 2017

Member

@batzen uuups, didn't see the inheritence ...

/// </summary>
public static readonly DependencyProperty ResizeBorderThicknessProperty =
DependencyProperty.Register(nameof(ResizeBorderThickness), typeof(Thickness), typeof(MetroWindow), new PropertyMetadata(BorderlessWindowBehavior.GetDefaultResizeBorderThickness()));

This comment has been minimized.

@punker76

punker76 Aug 21, 2017

Member

this should be WindowChromeBehavior instead of the old BorderlessWindowBehavior

This comment has been minimized.

@batzen

batzen Aug 22, 2017

Contributor

Will use base class name here.

{
var behavior = new BorderlessWindowBehavior();
Interaction.GetBehaviors(this).Add(behavior);

This comment has been minimized.

@punker76

punker76 Aug 21, 2017

Member

all behaviors must be add here and not at the style

private void InitializeStylizedBehaviors()
{
    var collection = new StylizedBehaviorCollection();
    collection.Add(new BorderlessWindowBehavior());
    collection.Add(new WindowsSettingBehaviour());
    collection.Add(new GlowWindowBehavior());
    StylizedBehaviors.SetBehaviors(this, collection);
}

without that, the glow and settings behaviors are not working

This comment has been minimized.

@batzen

batzen Aug 22, 2017

Contributor

Will move behavior creation from the style to code behind.

@@ -567,12 +568,12 @@
<Setter Property="Behaviours:StylizedBehaviors.Behaviors">
<Setter.Value>
<Behaviours:StylizedBehaviorCollection>
<Behaviours:BorderlessWindowBehavior />
<Behaviours:WindowsSettingBehaviour />
<Behaviours:GlowWindowBehavior />
</Behaviours:StylizedBehaviorCollection>
</Setter.Value>
</Setter>

This comment has been minimized.

@punker76

punker76 Aug 21, 2017

Member

setting the behaviors must be done in InitializeStylizedBehaviors at code behind

@Deadpikle

This comment has been minimized.

Contributor

Deadpikle commented Aug 22, 2017

Just leaving a note here that this PR probably invalidates #2731 and might mean #2729 is either fixed or needs to "move" repositories. (I haven't tested to find out what the behavior is based on this PR.)

@batzen

This comment has been minimized.

Contributor

batzen commented Aug 22, 2017

@Deadpikle Those will need to move repositories as i haven't fixed them.

@punker76 punker76 added this to the 1.6.0 milestone Aug 23, 2017

batzen added some commits Aug 23, 2017

Removing System.Windows.Interactivity
System.Windows.Interactivity is now aquired through the dependency to ControlzEx

@punker76 punker76 merged commit 2431b50 into MahApps:develop Aug 25, 2017

1 check passed

continuous-integration/teamcity Finished TeamCity Build MahApps.Metro PullRequest :: MahApps.Metro PullRequests : Tests passed: 64
Details

@batzen batzen deleted the batzen:WindowChromeFromControlzEx branch Sep 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment