public MainWindow()
        {
            Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
            InitializeComponent();
            cbRunning.IsChecked = true;

            closeToTray();

            Instance      = this;
            ShowInTaskbar = false;

            ObservableCollection <ClientInformation> col = new ObservableCollection <ClientInformation>();

            for (int i = 0; i < 10; i++)
            {
                col.Add(ClientInformation.Empty);
            }
            dgPadding.DataContext = col;

            setTrayIcon();

            if (AuthentificationManager.Instance.usesPassword)
            {
                cbUsesPassword.IsChecked = true;
            }

            if (AutoStart.isInAutostart())
            {
                cbAutostart.IsChecked = true;
            }
        }
        private void cbAutostart_Unchecked(object sender, RoutedEventArgs e)
        {
            bool autostart = AutoStart.RemoveShortcut();

            if (autostart)
            {
                cbAutostart.IsChecked = true;
            }
        }
        private void cbAutostart_Checked(object sender, RoutedEventArgs e)
        {
            bool autostart = AutoStart.MakeShortcut();

            if (!autostart)
            {
                cbAutostart.IsChecked = false;
            }
        }