public static readonly BindableProperty OptionsProperty = BindableProperty.Create(
nameof(Options), typeof(List<Option>), typeof(LikertMultiple), propertyChanged: (bindable, oldValue, newValue) =>
{
var control = (LikertMultiple)bindable;
control.OptionsLabels.ItemsSource = (List<Option>)newValue;
control.columns = new List<ColumnDefinition>();
for (int i = 0; i < control.NumberOfColumns; i++)
{
ColumnDefinition col = new ColumnDefinition();
control.columns.Add(col);
control.myGrid.ColumnDefinitions.Add(col);
}
});
public static readonly BindableProperty RowsProperty = BindableProperty.Create(
nameof(Rows), typeof(List<LikertQuestion>), typeof(LikertMultiple), propertyChanged: (bindable, oldValue, newValue) =>
{
//Same for rows
}
});
public List<Option> Options
{
get => (List<Option>)GetValue(OptionsProperty);
set => SetValue(OptionsProperty, value);
}
public List<LikertQuestion> Rows
{
//same
}
public static readonly BindableProperty OptionsProperty = BindableProperty.Create(
nameof(Options), typeof(List<Option>), typeof(LikertMultiple), propertyChanged: (bindable, oldValue, newValue) =>
{
var control = (LikertMultiple)bindable;
control.OptionsLabels.ItemsSource = (List<Option>)newValue;
control.columns = new List<ColumnDefinition>();
for (int i = 0; i < control.NumberOfColumns; i++)
{
ColumnDefinition col = new ColumnDefinition();
control.columns.Add(col);
control.myGrid.ColumnDefinitions.Add(col);
}
});
public static readonly BindableProperty RowsProperty = BindableProperty.Create(
nameof(Rows), typeof(List<LikertQuestion>), typeof(LikertMultiple), propertyChanged: (bindable, oldValue, newValue) =>
{
//Same for rows
}
});
public List<Option> Options
{
get => (List<Option>)GetValue(OptionsProperty);
set => SetValue(OptionsProperty, value);
}
public List<LikertQuestion> Rows
{
//same
}