I'm working on WPF app that has multiple windows all connected to main window. Also WindowStyle is set to none so i don't have maximize and minimize buttons so I want to be able when i close dependent window to get back main. Problem is when i close dependent window main window is still minimized, i have to click on the icon on toolbar to bring it up. What am I doing wrong?
Here is the code for going to dependent window
private void ButtonVlasnici_Click(object sender, RoutedEventArgs e)
{
var win = new WinVlasnici();
win.Show();
WindowState = WindowState.Minimized;
}
and this is for going back to main:
private void ButtonNazad_Click(object sender, RoutedEventArgs e)
{
var win = new MainWindow();
win.WindowState = WindowState.Maximized;
Close();
}