Skip to content

Commit

Permalink
fixed topmost issue
Browse files Browse the repository at this point in the history
  • Loading branch information
foglio1024 committed May 14, 2017
1 parent 04cfc5e commit 5112b97
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 84 deletions.
20 changes: 5 additions & 15 deletions TCC.UI/ViewModels/AbnormalityWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@ public bool IsTeraOnTop
{
get => WindowManager.IsTccVisible;
}
private bool topMost;
public bool TopMost
{
get => topMost;
set
{
if (topMost != value)
{
topMost = value;
RaisePropertyChanged("TopMost");
}
}
}

public AbnormalityWindowViewModel()
{
Expand All @@ -35,8 +22,11 @@ public AbnormalityWindowViewModel()
RaisePropertyChanged("IsTeraOnTop");
if (IsTeraOnTop)
{
TopMost = false;
TopMost = true;
BuffBarWindowManager.Instance.Dispatcher.Invoke(() =>
{
WindowManager.BuffBar.Topmost = false;
WindowManager.BuffBar.Topmost = true;
});
}
};
}
Expand Down
24 changes: 8 additions & 16 deletions TCC.UI/ViewModels/BossGageWindowViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace TCC.ViewModels
using System;

namespace TCC.ViewModels
{
public class BossGageWindowViewModel : BaseINPC
{
Expand All @@ -15,19 +17,6 @@ public bool IsTeraOnTop
{
get => WindowManager.IsTccVisible;
}
private bool topMost;
public bool TopMost
{
get => topMost;
set
{
if (topMost != value)
{
topMost = value;
RaisePropertyChanged("TopMost");
}
}
}

public BossGageWindowViewModel()
{
Expand All @@ -37,8 +26,11 @@ public BossGageWindowViewModel()
RaisePropertyChanged("IsTeraOnTop");
if (IsTeraOnTop)
{
TopMost = false;
TopMost = true;
BossGageWindowManager.Instance.Dispatcher.Invoke(() =>
{
WindowManager.BossGauge.Topmost = false;
WindowManager.BossGauge.Topmost = true;
});
}
};

Expand Down
24 changes: 7 additions & 17 deletions TCC.UI/ViewModels/CharacterWindowViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using TCC.Data;
using System;
using TCC.Data;

namespace TCC.ViewModels
{
Expand All @@ -17,20 +18,6 @@ private void Player_PropertyChanged(object sender, System.ComponentModel.Propert
}
}

private bool topMost;
public bool TopMost
{
get => topMost;
set
{
if (topMost != value)
{
topMost = value;
RaisePropertyChanged("TopMost");
}
}
}


public CharacterWindowViewModel()
{
Expand All @@ -39,8 +26,11 @@ public CharacterWindowViewModel()
RaisePropertyChanged("IsTeraOnTop");
if (IsTeraOnTop)
{
TopMost = false;
TopMost = true;
CharacterWindowManager.Instance.Dispatcher.Invoke(() =>
{
WindowManager.CharacterWindow.Topmost = false;
WindowManager.CharacterWindow.Topmost = true;
});
}
};
}
Expand Down
21 changes: 5 additions & 16 deletions TCC.UI/ViewModels/CooldownWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,18 @@ public bool IsTeraOnTop
get => WindowManager.IsTccVisible;
}

private bool topMost;
public bool TopMost
{
get => topMost;
set
{
if (topMost != value)
{
topMost = value;
RaisePropertyChanged("TopMost");
}
}
}

public CooldownWindowViewModel()
{
WindowManager.TccVisibilityChanged += (s, ev) =>
{
RaisePropertyChanged("IsTeraOnTop");
if (IsTeraOnTop)
{
TopMost = false;
TopMost = true;
WindowManager.CooldownWindow.Dispatcher.Invoke(() =>
{
WindowManager.CooldownWindow.Topmost = false;
WindowManager.CooldownWindow.Topmost = true;
});
}
};
}
Expand Down
20 changes: 5 additions & 15 deletions TCC.UI/ViewModels/GroupWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@ public bool IsTeraOnTop
{
get => WindowManager.IsTccVisible;
}
private bool topMost;
public bool TopMost
{
get => topMost;
set
{
if (topMost != value)
{
topMost = value;
RaisePropertyChanged("TopMost");
}
}
}

public GroupWindowViewModel()
{
Expand All @@ -34,8 +21,11 @@ public GroupWindowViewModel()
RaisePropertyChanged("IsTeraOnTop");
if (IsTeraOnTop)
{
TopMost = false;
TopMost = true;
GroupWindowManager.Instance.Dispatcher.Invoke(() =>
{
WindowManager.GroupWindow.Topmost = false;
WindowManager.GroupWindow.Topmost = true;
});
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion TCC.UI/Windows/AbnormalitiesWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
xmlns:vm="clr-namespace:TCC.ViewModels"
mc:Ignorable="d"
Title="AbnormalitiesWindow" Height="Auto" Width="Auto"
Topmost="{Binding TopMost}"
Topmost="True"
ShowInTaskbar="False"
WindowStyle="None"
Background="#00000000"
Expand Down
2 changes: 1 addition & 1 deletion TCC.UI/Windows/BossGageWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
mc:Ignorable="d"
Title="BossGageWindow" Height="Auto" Width="Auto"
SizeToContent="WidthAndHeight"
Topmost="{Binding TopMost}"
Topmost="True"
AllowsTransparency="True"
ShowInTaskbar="False"
WindowStyle="None" Opacity=".85"
Expand Down
2 changes: 1 addition & 1 deletion TCC.UI/Windows/CharacterWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
mc:Ignorable="d"
Title="HPbar"
Height="Auto" Width="Auto"
Topmost="{Binding TopMost}"
Topmost="True"
Background="#00000000"
ShowInTaskbar="False"
WindowStyle="None"
Expand Down
2 changes: 1 addition & 1 deletion TCC.UI/Windows/CooldownWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Height="Auto"
Width="Auto"
SizeToContent="WidthAndHeight"
Topmost="{Binding TopMost}"
Topmost="True"
AllowsTransparency="True"
ShowInTaskbar="False"
WindowStyle="None"
Expand Down
2 changes: 1 addition & 1 deletion TCC.UI/Windows/GroupWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
WindowStyle="None"
AllowsTransparency="True"
ResizeMode="NoResize"
Topmost="{Binding TopMost}"
Topmost="True"
Opacity=".9" SizeToContent="WidthAndHeight"
Background="Transparent"
Title="GroupWindow" Height="Auto" Width="Auto"
Expand Down

0 comments on commit 5112b97

Please sign in to comment.