private void AddRelationButton_Click(object sender, RoutedEventArgs e)
 {
     if (this.DataContext != null)
     {
         Button button = (Button)sender;
         InstrumentSourceRelationWindow window = new InstrumentSourceRelationWindow((VmInstrument)this.DataContext, EditMode.AddNew);
         App.MainFrameWindow.MainFrame.Children.Add(window);
         window.IsModal = true;
         window.Show();
     }
 }
 private void RelationGrid_CellDoubleClicked(object sender, CellClickedEventArgs e)
 {
     if (!this.CanModify) return;
     if (e.Cell.Column.Key == "QuotationSource.Name" || e.Cell.Column.Key == FieldSR.SourceSymbol)
     {
         VmInstrumentSourceRelation vmRelation = e.Cell.Row.Data as VmInstrumentSourceRelation;
         if (vmRelation != null)
         {
             InstrumentSourceRelationWindow window = new InstrumentSourceRelationWindow((VmInstrument)this.DataContext, EditMode.Modify, vmRelation);
             App.MainFrameWindow.MainFrame.Children.Add(window);
             window.IsModal = true;
             window.Show();
         }
     }
 }