private void ExitEvent(DeviceInventory windowDeviceInv)
 {
     if ((string)windowDeviceInv.DataContext == "TypePage")
     {
         this.Visibility = Visibility.Visible;
         //windowDeviceInv.DataContext = null;
     }
     else if ((string)windowDeviceInv.DataContext == "Logout")
     {
         this.DataContext = "Logout";
         this.Close();
     }
     else
     {
         this.DataContext = "Exit";
         this.Close();
     }
 }
        private void OpenDevicePage(string ExitType)
        {
            this.Visibility = Visibility.Collapsed;
            string SelectedType = string.Empty;

            if (selectedType != null)
            {
                SelectedType = selectedType.TypeType.ToString();
            }
            else
            {
                SelectedType = "All";
            }

            var windowDeviceInv = new DeviceInventory(ExitType, SelectedType);

            windowDeviceInv.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            windowDeviceInv.ShowDialog();

            //selectedType = null;
            ExitEvent(windowDeviceInv);
        }