예제 #1
0
 public static ShapeSaveHelper GetInstance()
 {
     if (instance is null)
     {
         instance = new ShapeSaveHelper();
     }
     return(instance);
 }
예제 #2
0
        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;
        }