예제 #1
0
        void OnColorComboBoxSelectionChanged(object sender, SelectionChangedEventArgs args)
        {
            if (colorComboBox.SelectedItem == null)
            {
                return;
            }

            InkFileManager inkFileManager = (InkFileManager)flipView.SelectedItem;

            Color color = (Color)colorComboBox.SelectedItem;

            if (!inkFileManager.IsAnythingSelected)
            {
                inkFileManager.InkDrawingAttributes.Color = color;
                inkFileManager.UpdateAttributes();
            }
            else
            {
                foreach (InkStroke inkStroke in inkFileManager.InkManager.GetStrokes())
                {
                    if (inkStroke.Selected)
                    {
                        InkDrawingAttributes drawingAttrs = inkStroke.DrawingAttributes;
                        drawingAttrs.Color          = color;
                        inkStroke.DrawingAttributes = drawingAttrs;
                    }
                }
                inkFileManager.RenderAll();
            }
        }
예제 #2
0
        void OnPenSizeComboBoxSelectionChanged(object sender, SelectionChangedEventArgs args)
        {
            if (penSizeComboBox.SelectedItem == null)
            {
                return;
            }

            InkFileManager inkFileManager = (InkFileManager)flipView.SelectedItem;

            double penSize = (double)penSizeComboBox.SelectedItem;
            Size   size    = new Size(penSize, penSize);

            if (!inkFileManager.IsAnythingSelected)
            {
                inkFileManager.InkDrawingAttributes.Size = size;
                inkFileManager.UpdateAttributes();
            }
            else
            {
                foreach (InkStroke inkStroke in inkFileManager.InkManager.GetStrokes())
                {
                    if (inkStroke.Selected)
                    {
                        InkDrawingAttributes drawingAttrs = inkStroke.DrawingAttributes;
                        drawingAttrs.Size           = size;
                        inkStroke.DrawingAttributes = drawingAttrs;
                    }
                }
                inkFileManager.RenderAll();
            }
        }