Good afternoon. How can I set the Binding Path for primitives:BackgroundGrid.LineStroke? Now I'm trying to do so
primitives:BackgroundGrid.LineStroke="{Binding Path=SelectedColorGrid, ElementName=GridColorEditor, Mode=TwoWay, Converter={StaticResource customColorToBrushConverter}}"
it's not working. For example, it works as
primitives:BackgroundGrid.CellSize="{Binding Path=CellSize , Mode=TwoWay}"
My XAML code:
<StackPanel Orientation="Horizontal" Margin="10 0">
<CheckBox x:Name="ShowGridCheckBox" Content="{x:Static res:Resources.ShowGrid}" Width="110"
Margin="0 0 20 0" IsChecked="{Binding Path=GridEnable, Mode=TwoWay}"
Foreground="{telerik:Windows8Resource ResourceKey=StrongBrush}"
VerticalAlignment="Center" />
<telerik:RadDropDownButton Width="80" DropDownWidth="210"
HorizontalContentAlignment="Right" FlowDirection="RightToLeft"
DropDownButtonPosition="Left">
<Border Width="12" Height="12" Margin="2 3"
Background="{Binding SelectedColorGrid ,Mode=TwoWay, ElementName=GridColorEditor, Converter={StaticResource customColorToBrushConverter}}"
BorderBrush="#d6d4d4" BorderThickness="1" />
<telerik:RadDropDownButton.DropDownContent>
<telerik:RadColorEditor x:Name="GridColorEditor" FlowDirection="LeftToRight"
ActiveSections="SaturationValuePad, HuePad" HistoryCapacity="8"
SelectedColor="{Binding SelectedColorGrid ,Mode=TwoWay, Converter={StaticResource customColorToBrushConverter}}" />
</telerik:RadDropDownButton.DropDownContent>
</telerik:RadDropDownButton>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="10 12 10 0">
<TextBlock Text="{x:Static res:Resources.Cell}" Width="90" Margin="20 0" VerticalAlignment="Center" />
<TextBox Width="80" Text="{Binding CellSize, Mode=TwoWay}" />
</StackPanel>
where SelectedColorGrid and CellSize its:
public Size CellSize
{
get
{
Globals.Project.CellSize = cellSize;
if (cellSize == new Size(0, 0))
{ cellSize = new Size(20, 20); }
return this.cellSize;
}
set
{
if ((this.cellSize != value)&&(value!= new Size(0, 0)))
{
this.cellSize = value;
this.OnPropertyChanged("CellSize");
}
else if ((cellSize == new Size(0, 0))|| (value == new Size(0, 0)))
{ cellSize = new Size(20, 20); }
}
}
public Color SelectedColorGrid
{
get
{
Globals.Project.SelectedColorGrid = _selectedColorGrid;
return this._selectedColorGrid;
}
set
{
if (this._selectedColorGrid != value)
{
this._selectedColorGrid = value;
this.OnPropertyChanged("SelectedColorGrid");
}
}
}