<Grid Grid.Row="0" BackgroundColor="{StaticResource ColorBack002}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackLayout
x:Name="xSelectMode"
Grid.Column="0"
Margin="0"
BackgroundColor="Red"
HorizontalOptions="FillAndExpand"
Orientation="Vertical"
Spacing="0"
VerticalOptions="FillAndExpand" />
<ContentView
x:Name="xMainContentsView"
Grid.Column="1"
BackgroundColor="DarkSeaGreen"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand" />
<!--<StackLayout
x:Name="xMainContents"
Grid.Column="1"
HorizontalOptions="CenterAndExpand"
Orientation="Horizontal">
<ContentView x:Name="xMainContentsView" />
</StackLayout>-->
<!--<Grid Grid.Column="1" BackgroundColor="{StaticResource ColorBack002}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
</Grid>-->
</Grid>
private void InitModeSettings()
{
// [Cell Mode 설정]
foreach (CellMode item in Enum.GetValues(typeof(CellMode)))
{
CtrlButton btn = new CtrlButton()
{
Text = item.ToString(),
BtnID = (int)item,
HeightRequest = 70,
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.FillAndExpand
};
btn.Clicked += BtnCellModeClicked;
xSelectMode.Children.Add(btn);
}
//xMainContents.Children.Add(m_SingleMode);
//xMainContents.Children.Add(m_MultiModel);
}
private void BtnCellModeClicked(object sender, EventArgs e)
{
CtrlButton btn = sender as CtrlButton;
switch ((CellMode)btn.BtnID)
{
case CellMode.Single:
{
xMainContentsView.Content = null;
xMainContentsView.Content = m_SingleMode;
break;
}
case CellMode.Multi:
{
xMainContentsView.Content = null;
xMainContentsView.Content = m_MultiModel;
break;
}
case CellMode.Nanoliter:
{
break;
}
case CellMode.Sipper:
{
break;
}
case CellMode.Temperature:
{
break;
}
}
}
If you click the button on the left, you want to change the screen in the khaki color area.
For example, when you click Single, the Single screen appears, and when you click Multi, the Multi screen appears.
The m_SingleMode and m_MultiModel variables were created with ContentView respectively. I put the view in the content of xMainContentsView when clicked. But there was no change on the screen.
The background color is changed to red for single and blue for multi. If it says as expected, it should change to a red screen when you click a single button. The multi-click should turn blue screen.
What part am I having a problem with?
