コード例 #1
0
        /// <summary>
        /// Open file button activity
        /// </summary>
        private void OpenButton_OnClick(object sender, RoutedEventArgs e)
        {
            Dictionary <string, Shape> shapes = null;
            var openFile = new OpenFileDialog();

            if (openFile.ShowDialog().Value)
            {
                shapes = SerializationManager.DeserializePentagons(openFile.FileName);
                foreach (var shape in shapes)
                {
                    DrawingBoard.DrawingBoard.CurrentContext.Manager.Shapes.Add(shape.Key, shape.Value);
                    DrawingBoard.DrawingBoard.CurrentContext.Canvas.Children.Add(shape.Value);
                }
            }
        }