цвет текста

main
Пилипенко Андрей Борисович 3 weeks ago
parent c7f4012004
commit 808da09d6f

1
.gitignore vendored

@ -1,3 +1,4 @@
.vs/
bin/
obj/
*.user

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IsFirstTimeProjectOpen>False</IsFirstTimeProjectOpen>
<ActiveDebugFramework>net9.0-windows10.0.19041.0</ActiveDebugFramework>
<ActiveDebugProfile>Windows Machine</ActiveDebugProfile>
</PropertyGroup>
<ItemGroup>
<None Update="App.xaml">
<SubType>Designer</SubType>
</None>
<None Update="AppShell.xaml">
<SubType>Designer</SubType>
</None>
<None Update="MainPage.xaml">
<SubType>Designer</SubType>
</None>
<None Update="Platforms\Windows\App.xaml">
<SubType>Designer</SubType>
</None>
<None Update="Platforms\Windows\Package.appxmanifest">
<SubType>Designer</SubType>
</None>
<None Update="Resources\Styles\Colors.xaml">
<SubType>Designer</SubType>
</None>
<None Update="Resources\Styles\Styles.xaml">
<SubType>Designer</SubType>
</None>
</ItemGroup>
</Project>

@ -14,10 +14,11 @@ public static class PanelCollectionView
HeightRequest = 40,
BackgroundColor = Colors.Transparent,
BorderWidth = 0,
TextColor = Colors.Black,
HorizontalOptions = LayoutOptions.Fill,
};
// Устанавливаем тематический цвет текста
button.SetAppThemeColor(Button.TextColorProperty, Colors.Black, Colors.White);
button.SetBinding(Button.TextProperty, new Binding("DisplayText"));
button.SetBinding(Button.CommandParameterProperty, new Binding("."));
@ -35,14 +36,12 @@ public static class PanelCollectionView
var commonStates = new VisualStateGroup { Name = "CommonStates" };
var normalState = new VisualState { Name = "Normal" };
normalState.Setters.Add(new Setter { Property = Button.TextColorProperty, Value = Colors.Black });
var focusedState = new VisualState { Name = "Focused" };
focusedState.Setters.Add(new Setter { Property = Button.BorderColorProperty, Value = Colors.Blue });
focusedState.Setters.Add(new Setter { Property = Button.BorderWidthProperty, Value = 2 });
var pressedState = new VisualState { Name = "Pressed" };
pressedState.Setters.Add(new Setter { Property = Button.TextColorProperty, Value = Colors.Black });
pressedState.Setters.Add(new Setter { Property = Button.BackgroundColorProperty, Value = Color.FromArgb("#e0e0e0") });
commonStates.States.Add(normalState);

Loading…
Cancel
Save