private int FindIndexInEventListViewModels(EventViewModel element)
 {
     for (int i = 0; i < EventViewModels.Count; i++)
         if (EventViewModels[i] == element)
             return i;
     return -1;
 }
 void RenameSimilarEvents(EventViewModel callEventViewModel)
 {
     var simeventslist = SearchSimilarEvents(callEventViewModel.Name.Trim()).ToList();
     foreach (var ev in simeventslist)
     {
         if (EventViewModels[Events.IndexOf(ev)] == callEventViewModel) continue;
         string name = callEventViewModel.Name;
         EventViewModels[Events.IndexOf(ev)].Name = name + "*";
         ev.Name = name + "*";
     }
 }
 public void UpdateEvent(EventViewModel callEventViewModel)
 {
     if (EventViewModels.Count != Events.Count || !EventViewModels.Contains(callEventViewModel)) return;
     int index = EventViewModels.IndexOf(callEventViewModel);
     RenameSimilarEvents(callEventViewModel);
     Events[index].Name = callEventViewModel.Name;
     Events[index].Probability = callEventViewModel.Probability;
     NavigationWindowShower.IsSaved = false;
 }