public StatisticsWindow(GameStatistics statistics)
        {
            InitializeComponent();

            this.statistics = statistics;
            DataContext = statistics;
        }
예제 #2
0
        private void LoadStatistics()
        {
            if (!File.Exists(fileName))
            {
                Statistics = new GameStatistics();
                return;
            }

            XmlSerializer deserializer = new XmlSerializer(typeof(GameStatistics));
            using (TextReader reader = new StreamReader(fileName))
            {
                Statistics = deserializer.Deserialize(reader) as GameStatistics;
            }
        }