Files
SimpleNote/MainWindow.axaml
T
Ano-sys 8f6980a1e7 update
2025-03-27 21:39:34 +01:00

112 lines
7.5 KiB
XML

<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:SimpleNote"
mc:Ignorable="d" d:DesignWidth="40" d:DesignHeight="200"
x:Class="SimpleNote.MainWindow"
x:DataType="vm:ViewModel"
WindowStartupLocation="Manual"
TransparencyLevelHint="Transparent"
TransparencyBackgroundFallback="DimGray"
Background="Transparent"
Height="50"
SystemDecorations="None"
ExtendClientAreaToDecorationsHint="True"
CanResize="False"
Topmost="True"
Title="SimpleNote"
>
<Window.Styles>
<Style Selector="TextBox">
<Style Selector="^:focus">
<Setter Property="BorderBrush" Value="Transparent"/>
<Style Selector="^ /template/ Border#PART_BorderElement">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="1" />
</Style>
</Style>
<Style Selector="^:pointerover /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Background" Value="Transparent" />
</Style>
</Style>
</Window.Styles>
<!-- <Border CornerRadius="7.5" BorderBrush="rgba(128, 128, 128, 0.6)" BorderThickness="2" Background="rgba(128, 128, 128, 0.3)"> -->
<StackPanel Orientation="Horizontal">
<ExperimentalAcrylicBorder IsHitTestVisible="False">
<ExperimentalAcrylicBorder.Material>
<ExperimentalAcrylicMaterial
BackgroundSource="Digger"
TintColor="Green"
TintOpacity="0.5"
MaterialOpacity="0.65" />
</ExperimentalAcrylicBorder.Material>
</ExperimentalAcrylicBorder>
<TextBox x:Name="FocusBox" IsVisible="False"/>
<Button x:Name="AddButton" Margin="3,0"
Command="{Binding AddButtonPressedCommand}"
FontSize="{Binding FontSize}"
Width="40" HorizontalContentAlignment="Center"
Background="rgba(64, 64, 64, 0.6)"
Foreground="White"
>
+
</Button>
<ItemsControl ItemsSource="{Binding Notes}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:Note">
<Border CornerRadius="7.5"
Margin="5,5,0,5"
BorderBrush="rgba(0, 0, 0, 0.15)"
BorderThickness="2"
Background="rgba(64, 64, 64, 0.3)"
>
<StackPanel Margin="5" Background="Transparent" Orientation="Horizontal">
<TextBox Height="20"
CaretBrush="White"
BorderThickness="0"
Width="{Binding Width}"
TextChanged="TextBox_OnTextChanged"
Margin="0, 0, 0, 0"
Padding="5,0,5,0"
TextAlignment="Center"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="LightGray"
Background="Transparent"
IsHitTestVisible="True"
FontSize="{Binding FontSize}"
IsTabStop="False"
IsReadOnly="False"
Text="{Binding Content}"
VerticalContentAlignment="Center"
KeyDown="InputElement_OnKeyDown"
>
</TextBox>
<Button Command="{Binding RemoveButtonClicked}"
FontSize="{Binding FontSize}"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Width="25"
Padding="1,-3,0,0"
Margin="5,0,0,0"
Background="rgba(64, 64, 64, 0.3)"
Foreground="White">
x
</Button>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<!-- </Border> -->
</Window>