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

metrowindow topmost property binding issue #3738

Closed
sg2707 opened this issue Feb 13, 2020 · 7 comments
Closed

metrowindow topmost property binding issue #3738

sg2707 opened this issue Feb 13, 2020 · 7 comments
Labels
Milestone

Comments

@sg2707
Copy link

sg2707 commented Feb 13, 2020

I am using MahApps for my WPF application and when the metro window is used, the TopMost property is not able to bind. If i set it as a static value it works though.

<Controls:MetroWindow x:Class="SabreContractSearch.Views.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:prism="http://prismlibrary.com/"
        xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
        prism:ViewModelLocator.AutoWireViewModel="True"
        Topmost= "{Binding Pin}" Title="{Binding Title}" Height="350" Width="525" Name="FrmMainWindow" >

Pin is a boolean property here.

If i remove the metro window and use the normal window tag for WPF, it works. Is this a bug?

@punker76
Copy link
Member

@sg2707 This should be working in v1.6.5 and current source. The main demo has a Binding to this property via Menu Item. So maybe you can create or upload this simple sample here on GitHub? Thx.

image

@sg2707
Copy link
Author

sg2707 commented Feb 13, 2020

In this example it is binding the menu item to the Window property, What I am trying is to bind the viewmodel property to the window property.

Topmost= "{Binding Pin}"

@timunie
Copy link
Collaborator

timunie commented Feb 13, 2020

Hi @sg2707
I think there should be no difference between Binding to MenuItem and ViewModel. It would be useful to have a look into your App or a sample App. I think there is an issue in the MVVM.

Happy coding,
Tim

@sg2707
Copy link
Author

sg2707 commented Feb 13, 2020

As i mentioned in the issue, if i change the metro window to WPF window, there is no issue. same code works. Check attachment.

Press
image

ContractSearch.zip

@timunie
Copy link
Collaborator

timunie commented Feb 13, 2020

@sg2707 I can confirm the issue with your repro.

@punker76 punker76 added the Bug label Feb 13, 2020
@punker76 punker76 added this to the 2.0.0 milestone Feb 13, 2020
@punker76
Copy link
Member

@sg2707 I found the bug. It happens at WindowChromeBehavior from ControlzEx. The Binding will be broken by our Topmost hack. I will fix this.

@punker76
Copy link
Member

@sg2707 It's fixed now and available with ControlzEx v4.2.2

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

No branches or pull requests

3 participants