Reputation: 243
I have Grid that has some buttons and I need to arrange the order of the button according to the config file. Below is my Button class where I set the properties of the button. Is there any way to set the Grid.ColumnsSpan for these buttons?
public class ButtonModel
{
public int Index { get; set; }
public string Content { get; set; }
public ImageSource Image { get; set; }
public ICommand Command { get; set; }
}
Upvotes: 0
Views: 115
Reputation: 18578
If your Button model has information regarding what should be columnspan for its button.. then you can directly bind the Grid.Column span in xaml to it...
<Button Grid.ColumnSpan="{Binding ColumnSpan}"/>
assuming buttonmodel has property ColumnSpan..which you initialized from your configuration..
Upvotes: 1