<ContentPage.Resources>
<ResourceDictionary>
<Style x:Key="FocusedStyle" TargetType="inputLayout:SfTextInputLayout">
<Setter Property="ContainerBackgroundColor" Value="Yellow" />
</Style>
<Style x:Key="UnFocusedStyle" TargetType="inputLayout:SfTextInputLayout">
<Setter Property="ContainerBackgroundColor" Value="Red" />
</Style>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<inputLayout:SfTextInputLayout x:Name="textInput" Hint="ComboBox">
<combobox:SfComboBox IsEditableMode="False" SelectedItem="Uganda" Unfocused="SfComboBox_Unfocused" Focused="SfTextInputLayout_Focused">
...
</combobox:SfComboBox>
</inputLayout:SfTextInputLayout>
</ContentPage.Content> |
private void SfTextInputLayout_Focused(object sender, FocusEventArgs e)
{
textInput.Style = (Style)this.Resources["FocusedStyle"];
}
private void SfComboBox_Unfocused(object sender, FocusEventArgs e)
{
textInput.Style = (Style)this.Resources["UnFocusedStyle"];
} |