Пример #1
0
        public static Stone GetCurrentSelectedStone()
        {
            if (ViewControl.SelectedItem != null)
            {
                StonesRepository rep = new StonesRepository(CurrentPath);
                //TODO move this to  a property getter
                string filename = (string)((StackPanel)(ViewControl).SelectedItem).Tag;

                Stone stone = rep.LoadStoneByFilenameInCurrentFolder(filename);

                if (stone != null)
                {
                    return stone;
                }
                else
                {
                    return rep.CreateAnewStoneSkeleton(filename);

                }

            }

            return null;
        }