コード例 #1
0
        public GraphEditDialog(ILogger logger, ColorProfile colorProfile, Graph graph, GraphEditDialogViewModel viewModel)
        {
            DataContext       = viewModel;
            this.logger       = logger;
            this.colorProfile = colorProfile;
            this.graph        = graph;
            this.viewModel    = viewModel;

            // initialize viewmodel
            viewModel.Name  = graph.Name;
            viewModel.Shape = new ShapeSelection()
            {
                Shape = graph.Shape,
                Color = colorProfile.GetColorFromShape(graph.Shape)
            };
            viewModel.Content = graph.Content;

            InitializeComponent();
        }
コード例 #2
0
 private void Graphs_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     graphListItems.Clear();
     foreach (var graph in graphs)
     {
         graphListItems.Add(new GraphListItem(graph, colorProfile.GetColorFromShape(graph.Shape)));
         if (e.Action == NotifyCollectionChangedAction.Add)
         {
             foreach (Graph g in e.NewItems)
             {
                 foreach (var s in g.Strokes)
                 {
                     if (!strokes.Contains(s))
                     {
                         strokes.Add(s);
                     }
                 }
             }
         }
     }
 }
コード例 #3
0
 private void ProcessColor(Graph graph)
 {
     SetColor(graph.Strokes, colorProfile.GetColorFromShape(graph.Shape));
 }