B
B
BadCats2017-07-02 18:40:20
WPF
BadCats, 2017-07-02 18:40:20

System.InvalidOperationException in wpf?

Brush_Control.BrushData.SetValue(BrushClass.BrushProperty, 5);

"Cannot set object property '#FFFFFFFF' because it is in read-only state."
Actually BrushData
public Brush BrushData
        {
            get { return (Brush)GetValue(BrushProperty); }
            set { SetValue(BrushProperty, value); }
        }

Binding to element
<ControlBrush:BrushClass
            x:Name="Brush_Control"
            BrushData="{Binding ElementName=canvas1,Path=Background}">
        </ControlBrush:BrushClass>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question