92 lines
6.3 KiB
XML
92 lines
6.3 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="15" BorderBrush="White" BorderThickness="2" Background="#000000aa">-->
|
|
<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 Margin="5,0" Command="{Binding AddButtonPressedCommand}" FontSize="{Binding FontSize}" Width="40" HorizontalContentAlignment="Center">
|
|
+
|
|
</Button>
|
|
<ItemsControl ItemsSource="{Binding Notes}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Horizontal"/>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate x:DataType="vm:Note">
|
|
<Border CornerRadius="15" Margin="5,5,0,5" BorderBrush="#fff" BorderThickness="2" Background="Transparent">
|
|
<StackPanel Margin="5" Background="Transparent" Orientation="Horizontal">
|
|
<TextBox Height="20"
|
|
CaretBrush="Transparent"
|
|
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="White"
|
|
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">
|
|
x
|
|
</Button>
|
|
</StackPanel>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</StackPanel>
|
|
<!--</Border>-->
|
|
</Window>
|