public static ComponentsList GetInstance() { if (_instance == null) { _instance = new ComponentsList(); } return(_instance); }
private void DataGrid_OnMouseDoublClick(object sender, MouseButtonEventArgs e) { var frameworkElement = (FrameworkElement)sender; var component = frameworkElement.DataContext as IGuiComponent; var componentsList = ComponentsList.GetInstance(); if (component.State == false) { component.State = true; componentsList.AddComponent(component); } else { component.State = false; } }