Files
desktop-edge-win/DesktopEdge/Views/Controls/StyledButton.xaml
T
2026-03-20 09:10:29 -04:00

68 lines
3.0 KiB
XML

<!--
Copyright NetFoundry Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<UserControl x:Class="ZitiDesktopEdge.StyledButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ZitiDesktopEdge"
mc:Ignorable="d"
d:DesignHeight="30" d:DesignWidth="300" Cursor="Hand">
<UserControl.Resources>
<Color x:Key="DisabledText">#FF3A3A3A</Color>
<SolidColorBrush x:Key="DisabledTextBrush" Color="#000000"/>
<Style x:Key="Disabled" TargetType="Rectangle">
<Setter Property="Fill" Value="#FF607696"/>
</Style>
<Style x:Key="Enabled" TargetType="Rectangle">
<Setter Property="Fill" Value="#0069FF"/>
</Style>
<Style x:Key="Dark" TargetType="Rectangle">
<Setter Property="Fill" Value="#000000"/>
</Style>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<Rectangle x:Name="ButtonBg"
Opacity="0.8" RadiusX="7"
RadiusY="7" ClipToBounds="True" Height="30"
VerticalAlignment="Bottom" MouseUp="DoClick"
Cursor="Hand" MouseEnter="Hover"
MouseLeave="Leave" MouseDown="Down"
Style="{StaticResource Enabled}"
Margin="{Binding ButtonMargin, RelativeSource={RelativeSource AncestorType=local:StyledButton}}"
/>
<Rectangle x:Name="ButtonBgDarken"
Opacity="0.0" RadiusX="7"
RadiusY="7" ClipToBounds="True" Height="30"
VerticalAlignment="Bottom" MouseUp="DoClick"
Cursor="Hand" MouseEnter="Hover"
MouseLeave="Leave" MouseDown="Down"
Style="{StaticResource Dark}"
Margin="{Binding ButtonMargin, RelativeSource={RelativeSource AncestorType=local:StyledButton}}"
/>
<Label x:Name="ButtonLabel" HorizontalAlignment="Center"
IsHitTestVisible="False" Foreground="#FFFFFF" Grid.Row="8"></Label>
</Grid>
</UserControl>