public static ShapeSaveHelper GetInstance() { if (instance is null) { instance = new ShapeSaveHelper(); } return(instance); }
public MainWindow() { ResizeMode = ResizeMode.NoResize; InitializeComponent(); try { shapeSaveHelper = ShapeSaveHelper.GetInstance(); shapeSaveHelper.Init(new JsonShapeReadWriter(JsonShapeReadWriter.DefaultDataCatalog)); shapes = shapeSaveHelper.LoadShapes(); shapeList.ItemsSource = shapes; } catch (Exception ex) { MessageBox.Show(ex.Message); Close(); } Closed += MainWindowClosed; }