Ejemplo n.º 1
0
        void SaveCanvas()
        {
            /*
             * if (SelectedControl != null && SelectedControl is Control)
             * {
             *
             *  if (ChangeColor(SelectedControl))
             *      ((Control)SelectedControl).Background = selbackground;
             *
             * }
             */
            RemoveSelectedItemEffect();

            SelectedControl = null;

            if (SelectedPosition >= 0)
            {
                if (!InPresentationMode)
                {
                    LastSelected.SetCanvasImage((BitmapSource) new ImageSourceConverter().ConvertFrom(CanvasWriter.SaveCanvasToImg(DesignCanvas, CanvasImgX, CanvasImgY)));
                }

                //SaveRichTextbox(DesignCanvas);

                RemoveUnloadEvent();

                CanvasSaveLoad.ToSerializableCanvas(data, DesignCanvas, SelectedPosition);

                string can = CanvasWriter.SerializeToXAML(DesignCanvas);
                data.pages[SelectedPosition].canvas     = can;
                data.pages[SelectedPosition].isUnlocked = DesignCanvas.IsEnabled;
                data.SavedVersionCode = MainWindow.VersionCode;
            }
        }
Ejemplo n.º 2
0
 void UpdateCurrentCanvasIcon()
 {
     ((TestType_ControlN)Stack_TestList.Children[SelectedPosition]).SetCanvasImage((BitmapSource) new ImageSourceConverter().ConvertFrom(CanvasWriter.SaveCanvasToImg(DesignCanvas, CanvasImgX, CanvasImgY)));
 }