Skip to content

Commit

Permalink
Replace maui switch with TMSwitch in Boolean Column in DataGrid (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
BAL4-R authored Sep 6, 2023
1 parent ac33512 commit 2b732cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
x:Class="Trimble.Modus.Components.BooleanColumn">
<modus:DataGridColumn.CellTemplate>
<DataTemplate>
<Switch IsToggled="{Binding}"
HorizontalOptions="Center" />
<modus:TMSwitch HorizontalOptions="Center" />
</DataTemplate>
</modus:DataGridColumn.CellTemplate>
</modus:DataGridColumn>
</modus:DataGridColumn>
4 changes: 2 additions & 2 deletions Trimble.Modus.Components/Controls/TMDataGrid/DataGridRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ private View CreateCell(DataGridColumn col)
}
else if(col is BooleanColumn booleanColumn)
{
var switchElement = (cell as ContentView)?.Content as Switch;
switchElement?.SetBinding(Switch.IsToggledProperty, new Binding(booleanColumn.PropertyName, source: BindingContext));
var switchElement = (cell as ContentView)?.Content as TMSwitch;
switchElement?.SetBinding(TMSwitch.IsToggledProperty, new Binding(booleanColumn.PropertyName, source: BindingContext));
}
}
else
Expand Down

0 comments on commit 2b732cd

Please sign in to comment.