/// <summary>
 /// eventhandler kliendi lisamiseks, avab KlientDetailVaade
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnLisaKlient_Click(object sender, RoutedEventArgs e)
 {
     var uusaken = new KlientDetailVaade();
     uusaken.Show();
 }
 /// <summary>
 /// eventhandler, mis avab uue KlientDetailVaade valitud kliendiga või tagastab RentDetailVaade-le valitud kliendi
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void lviewKliendid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (lviewKliendid.SelectedItem != null)
     {
         if (datacontext.klikkfunktsioon == false)
         {
             var uusdetail = new KlientDetailVaade(this.lviewKliendid.SelectedItem as KlientBO);
             uusdetail.Show();
         }
         else
         {
             datacontext.rentDetailVaade.gridKlient.DataContext = (lviewKliendid.SelectedItem as KlientBO);
             this.Close();
         } 
     }
 }
        /// <summary>
        /// Lisa nupu eventhandler, mis lisab kliendi
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLisa_Click(object sender, RoutedEventArgs e)
        {
            TeeUpdateSource();
            if (datacontext.UuendaKlient())
            {
                var uusaken = new KlientDetailVaade();
                uusaken.Top = this.Top;
                uusaken.Left = this.Left;
                uusaken.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Lisamine ebaõnnestus");
            }

        }