Update position when window is shown (#107)
This commit is contained in:
parent
5ada0e41d8
commit
35a0cfdcbd
1 changed files with 12 additions and 0 deletions
|
|
@ -72,6 +72,18 @@ namespace Observatory.UI.Views
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void Show()
|
||||||
|
{
|
||||||
|
base.Show();
|
||||||
|
|
||||||
|
// Refresh the position when the window is opened (required
|
||||||
|
// on Linux to show the notification in the right position)
|
||||||
|
if (DataContext is NotificationViewModel nvm)
|
||||||
|
{
|
||||||
|
AdjustPosition(nvm.Notification.XPos / 100, nvm.Notification.YPos / 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void NotificationView_DataContextChanged(object sender, EventArgs e)
|
private void NotificationView_DataContextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var notification = ((NotificationViewModel)DataContext).Notification;
|
var notification = ((NotificationViewModel)DataContext).Notification;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue