none
Silverlight Border Thickness is not applying using Binding RRS feed

  • Question

  •  Hi

    Hi

    Border thickness is not applying for Borders using Binding path, the values are returning from ViewModel and Xaml.cs file

    [VIEWMODEL]

    private Thickness theThickness = new Thickness() { Left = 2, Right = 2, Top = 2, Bottom = 2 };

            public Thickness TheThickness
            {
                get { return theThickness; }
                set
                {
                    theThickness = value;
                    NotifyPropertyChanged(m => m.TheThickness);
                }
            }

    In XAML.cs file

    public void BindData(List<GetEmployeeData> data)
    {
    if(somecondition)
    model.TheThickness = new Thickness(2);

    else

    model.TheThickness = new Thickness(4);

    }

    XAML Page

      <sdk:PivotViewer.ItemTemplates>
                    <sdk:PivotViewerItemTemplate  >
                        <Border x:Name="itemborderdata"   
                                BorderBrush="Red"                             
                                  BorderThickness="{Binding TheThickness, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=navigation:Page}, Converter={StaticResource TheThickness}
            }" >

    Please help me to solve this issue Border is not displaying in UI, if I keep static value like BorderThickness="2" border shows in the silverlight UI

    Thanks,

    Lokesh

    Monday, April 10, 2017 1:59 PM