Skip to content

Commit

Permalink
信息看板显示日期
Browse files Browse the repository at this point in the history
  • Loading branch information
STBBRD committed Feb 2, 2024
1 parent 367bcf1 commit 04269b0
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
11 changes: 4 additions & 7 deletions ZongziTEK_Blackboard_Sticker/LauncherEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,17 @@ private async void LoadList()
HorizontalAlignment = HorizontalAlignment.Right,
Width = 36,
Height = 36,
Background = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0))
Background = Brushes.Transparent,
Padding = new Thickness(0),
BorderThickness = new Thickness(0),
};

SymbolIcon DeleteIcon = new()
{
Symbol = Symbol.Delete
};

Viewbox DeleteIconViewbox = new()
{
Child = DeleteIcon
};

DeleteButton.Content = DeleteIconViewbox;
DeleteButton.Content = DeleteIcon;


//开始组装按钮
Expand Down
4 changes: 2 additions & 2 deletions ZongziTEK_Blackboard_Sticker/Pages/DatePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<Grid Margin="16,8" HorizontalAlignment="Right">
<Viewbox>
<ui:SimpleStackPanel Spacing="4">
<Label Content="2024 年 1 月 31 日" FontSize="32" HorizontalAlignment="Right" Foreground="{DynamicResource ForegroundColor}"/>
<Label Content="星期三" FontSize="32" HorizontalAlignment="Right" Foreground="{DynamicResource ForegroundColor}"/>
<Label Name="LabelDate" Content="2024 年 1 月 31 日" FontSize="32" HorizontalAlignment="Right" Foreground="{DynamicResource ForegroundColor}"/>
<Label Name="LabelDayOfWeek" Content="星期三" FontSize="32" HorizontalAlignment="Right" Foreground="{DynamicResource ForegroundColor}"/>
</ui:SimpleStackPanel>
</Viewbox>
</Grid>
Expand Down
16 changes: 16 additions & 0 deletions ZongziTEK_Blackboard_Sticker/Pages/DatePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;

namespace ZongziTEK_Blackboard_Sticker.Pages
{
Expand All @@ -23,6 +24,21 @@ public partial class DatePage : Page
public DatePage()
{
InitializeComponent();

Timer_Tick(null, null);

timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromMilliseconds(500);
timer.Tick += Timer_Tick;
timer.Start();
}

private DispatcherTimer timer;

private void Timer_Tick(object sender, EventArgs e)
{
LabelDate.Content = DateTime.Now.ToString("yyyy 年 M 月 d 日");
LabelDayOfWeek.Content = DateTime.Now.ToString("dddd");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@
<Compile Include="Pages\WeatherPage.xaml.cs">
<DependentUpon>WeatherPage.xaml</DependentUpon>
</Compile>
<Compile Include="Resources\Controls\TimetableEditorItem.xaml.cs">
<Compile Include="Controls\TimetableEditorItem.xaml.cs">
<DependentUpon>TimetableEditorItem.xaml</DependentUpon>
</Compile>
<Compile Include="Resources\Controls\TimeTextBox.cs" />
<Compile Include="Controls\TimeTextBox.cs" />
<Compile Include="TimetableEditor.xaml.cs">
<DependentUpon>TimetableEditor.xaml</DependentUpon>
</Compile>
Expand All @@ -114,7 +114,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Resources\Controls\TimetableEditorItem.xaml">
<Page Include="Controls\TimetableEditorItem.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down

0 comments on commit 04269b0

Please sign in to comment.