Notes/Notes.UI/Views/NoteView.axaml

113 lines
5.9 KiB
XML

<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Notes.Views"
xmlns:viewModels="clr-namespace:Notes.ViewModels;assembly=Notes.Data"
xmlns:notes="clr-namespace:Notes"
x:DataType="viewModels:NoteViewModel">
<Design.PreviewWith>
<Border Width="500" Height="400">
<StackPanel>
<Button Width="100" Height="100" VerticalContentAlignment="Bottom">aaaaaa</Button>
<ContentPresenter>
<ContentPresenter.Content>
<viewModels:NoteViewModel/>
</ContentPresenter.Content>
<ContentPresenter.ContentTemplate>
<notes:ViewSelector />
</ContentPresenter.ContentTemplate>
</ContentPresenter>
</StackPanel>
</Border>
</Design.PreviewWith>
<!-- Set Defaults -->
<Style Selector="TextBox:focus /template/ Border">
<Setter Property="Background" Value="#c7edcc"></Setter>
</Style>
<Style Selector="TextBox /template/ Border">
<Setter Property="Background" Value="#c0edc0"></Setter>
</Style>
<Style Selector="controls|NoteView">
<Setter Property="Template">
<ControlTemplate>
<DockPanel>
<Grid ColumnDefinitions="*,2,8*">
<ListBox Name="listNotes"
Grid.Column="0"
BorderThickness="1"
BorderBrush="Black"
Background="Bisque"
ItemsSource="{Binding AllNotesViewModel.Notes}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding ShortName}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<GridSplitter Grid.Column="1" ResizeDirection="Auto"></GridSplitter>
<Border Grid.Column="2" BorderThickness="1" BorderBrush="Black" Background="#559978">
<DockPanel>
<DockPanel Height="28" DockPanel.Dock="Top">
<Button Command="{Binding ChangeTitleCommand}" DockPanel.Dock="Right">修改</Button>
<TextBox
Name="iptTitle"
IsHitTestVisible="{Binding IsEditingTitle}"
Text="{Binding Title}"
FontSize="20" Padding="5,2" MinHeight="28"
Watermark="请输入标题" />
</DockPanel>
<DockPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom">
<Button Name="btnEdit"
MinHeight="24"
Height="24"
FontSize="14"
Margin="3"
Padding="8,2,8,2"
Command="{Binding ChangeEditTextStateCommand}"
Content="{Binding EditButtonText}">
</Button>
<Button Name="btnSave"
MinHeight="24"
Height="24"
FontSize="14"
Margin="3"
Command="{Binding SaveNoteCommand}"
Padding="8,2,8,2">
保存
</Button>
<Button Name="btnBack"
MinHeight="24"
Height="24"
FontSize="14"
Margin="3"
Command="{Binding BackCommand}"
Padding="8,2,8,2">
返回
</Button>
<Button Name="btnNew"
MinHeight="24"
Height="24"
FontSize="14"
Margin="3"
Command="{Binding NewNoteCommand}"
Padding="8,2,8,2">
新建
</Button>
</StackPanel>
<TextBox
Name="iptContent"
Text="{Binding Text}"
IsHitTestVisible="{Binding IsEditingText}" />
</DockPanel>
</DockPanel>
</Border>
</Grid>
</DockPanel>
</ControlTemplate>
</Setter>
</Style>
</Styles>