main
Stepan Pilipenko 3 weeks ago
parent 354adb75da
commit f7ad317c67

@ -327,6 +327,29 @@ public partial class MainPage : ContentPage, INotifyPropertyChanged
CornerRadius = 0
};
// Устанавливаем тематический цвет текста
// button.SetAppThemeColor(Button.TextColorProperty, Colors.Black, Colors.White);
// Визуальные состояния для фокуса
var visualStateGroups = new VisualStateGroupList();
var commonStates = new VisualStateGroup { Name = "CommonStates" };
var normalState = new VisualState { Name = "Normal" };
normalState.Setters.Add(new Setter { Property = Button.BackgroundColorProperty, Value = NormalButtonColor });
var focusedState = new VisualState { Name = "Focused" };
focusedState.Setters.Add(new Setter { Property = Button.BackgroundColorProperty, Value = FocusedButtonColor });
var pressedState = new VisualState { Name = "Pressed" };
pressedState.Setters.Add(new Setter { Property = Button.BackgroundColorProperty, Value = NormalButtonColor });
commonStates.States.Add(normalState);
commonStates.States.Add(focusedState);
commonStates.States.Add(pressedState);
visualStateGroups.Add(commonStates);
VisualStateManager.SetVisualStateGroups(button, visualStateGroups);
// Обработчик клика - выделение при клике, открытие при двойном клике
button.Clicked += (s, e) => HandleItemClick(button, item, isLeft);

Loading…
Cancel
Save