private void mnuOpenSurfDetail_Click(object sender, RoutedEventArgs e) { string selectedObserverImage = string.Empty; string selectedModelImage = string.Empty; MenuItem mnu = sender as MenuItem; Border selectedBorder = null; if (mnu != null) { selectedBorder = ((ContextMenu)mnu.Parent).PlacementTarget as Border; selectedObserverImage = (string)selectedBorder.Tag; } selectedModelImage = QueryImageFullPath; bool isObserverImagePathFound = !string.IsNullOrWhiteSpace(selectedObserverImage); isObserverImagePathFound = isObserverImagePathFound && File.Exists(selectedObserverImage); bool isModelImagePathFound = !string.IsNullOrWhiteSpace(selectedModelImage); isModelImagePathFound = isObserverImagePathFound && File.Exists(selectedModelImage); if (isObserverImagePathFound & isModelImagePathFound) { SurfSettings surfSetting = GetSurfSetting(); if (SelectedAlgo == emAlgo.SURF) { DrawSurfMatches.MatchInWindow(selectedModelImage, selectedObserverImage, surfSetting); } else { AccordSurfWindow win = new AccordSurfWindow(selectedModelImage, selectedObserverImage, surfSetting); win.Show(); } } }