Repository navigation
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
109 lines (99 loc) · 3.73 KB
/
Copy pathMainWindow.xaml
File metadata and controls
109 lines (99 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<Window x:Class="Diary.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="My Diary" Height="500" Width="900"
Background="#f4f6f9">
<Window.Resources>
<!-- Rounded Button Style -->
<Style x:Key="RoundedButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#3498db"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Padding" Value="8,4"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="8"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Rounded TextBox Style -->
<Style TargetType="TextBox">
<Setter Property="BorderBrush" Value="#2c3e50"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="6"/>
<Setter Property="Background" Value="White"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border CornerRadius="6"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}">
<ScrollViewer x:Name="PART_ContentHost"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="220"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Sidebar -->
<StackPanel Background="#2c3e50" Width="220" VerticalAlignment="Stretch">
<TextBlock Text="📖 My Diary"
Foreground="White"
FontSize="18"
FontWeight="Bold"
Margin="20,20,0,20"/>
<TextBlock Text="Calendar"
Foreground="#bdc3c7"
FontSize="14"
Margin="20,10,0,5"/>
<!-- Calendar -->
<Calendar x:Name="calendar"
Margin="10"
SelectedDatesChanged="Calendar_SelectedDatesChanged"/>
</StackPanel>
<!-- Main Content -->
<StackPanel Grid.Column="1" Margin="20">
<!-- Date Display -->
<TextBlock x:Name="lblDate"
Text="{Binding SelectedDate, ElementName=calendar, StringFormat='{}{0:MMMM d, yyyy}'}"
FontSize="20"
FontWeight="Bold"
Foreground="#2c3e50"
Margin="0,0,0,20"/>
<!-- Title -->
<TextBox x:Name="txtTitle"
Height="35"
Margin="0,0,0,10"/>
<!-- Content -->
<TextBox x:Name="txtContent"
Height="250"
TextWrapping="Wrap"
AcceptsReturn="True"
VerticalScrollBarVisibility="Auto"/>
<!-- Action Buttons -->
<StackPanel Orientation="Horizontal" Margin="0,20,0,0">
<Button Content="💾 Save"
Width="100"
Height="35"
Style="{StaticResource RoundedButtonStyle}"
Click="Save_Click"/>
</StackPanel>
</StackPanel>
</Grid>
</Window>