From 45c004d4bb5a6f73843a8e8020523f4df14a14e4 Mon Sep 17 00:00:00 2001 From: Chr <haoran.cheng@skonda.com.cn> Date: 星期二, 20 八月 2024 19:17:07 +0800 Subject: [PATCH] 完善消息通知程序; --- PdmAlert/MainWindow.xaml | 182 +++++++++++++++++++++++++-------------------- 1 files changed, 101 insertions(+), 81 deletions(-) diff --git a/PdmAlert/MainWindow.xaml b/PdmAlert/MainWindow.xaml index 1f51b53..3defeb9 100644 --- a/PdmAlert/MainWindow.xaml +++ b/PdmAlert/MainWindow.xaml @@ -6,115 +6,135 @@ xmlns:local="clr-namespace:PdmAlert" mc:Ignorable="d" WindowStyle="None" + Topmost="True" ResizeMode="NoResize" WindowStartupLocation="Manual" Loaded="Window_Loaded" + Deactivated="Window_Deactivated" + ShowInTaskbar="False" Title="MainWindow" Height="600" Width="400"> <Window.Resources> - <Brush x:Key="MainBorder">#0d4d84</Brush> - <Brush x:Key="MainMenu">#1d6eb2</Brush> - <Brush x:Key="ChildBorder">#3692e1</Brush> - <Brush x:Key="MainStatusBar">#1d6eb2</Brush> + <ResourceDictionary> + <FontFamily x:Key="iconfont"> + /PdmAlert;component/Icon/#iconfont + </FontFamily> + <Brush x:Key="MainBorder">#0d4d84</Brush> + <Brush x:Key="MainMenu">#1d6eb2</Brush> + <Brush x:Key="ChildBorder">#3692e1</Brush> + <Brush x:Key="MainStatusBar">#1d6eb2</Brush> - <Brush x:Key="SecondaryImportant">Orange</Brush> - <Brush x:Key="Important">#e17933</Brush> - <Brush x:Key="ImportantFont">#FFF</Brush> + <Brush x:Key="SecondaryImportant">Orange</Brush> + <Brush x:Key="Important">#e17933</Brush> + <Brush x:Key="ImportantFont">#FFF</Brush> - <Brush x:Key="ButtonColor">#103156</Brush> - <Brush x:Key="ButtonSelected">#02579E</Brush> - <Brush x:Key="ButtonFont">White</Brush> - <Brush x:Key="ButtonFontSelected">White</Brush> - - <Style x:Key="WindowButton" TargetType="Button"> - <Setter Property="Background" Value="Transparent"/> - <Setter Property="FontWeight" Value="SemiBold"/> - <Setter Property="Foreground" Value="White"/> - <Setter Property="Width" Value="50"/> - <Setter Property="FontSize" Value="20"/> - <Setter Property="BorderThickness" Value="0"/> - <Setter Property="BorderBrush" Value="Transparent"/> + <Brush x:Key="ButtonColor">#103156</Brush> + <Brush x:Key="ButtonSelected">#02579E</Brush> + <Brush x:Key="ButtonFont">White</Brush> + <Brush x:Key="ButtonFontSelected">White</Brush> + + <Style x:Key="WindowButton" TargetType="Button"> + <Setter Property="FontFamily" Value="{StaticResource iconfont}"/> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="FontWeight" Value="SemiBold"/> + <Setter Property="Foreground" Value="Black"/> + <Setter Property="Width" Value="50"/> + <Setter Property="FontSize" Value="20"/> + <Setter Property="BorderThickness" Value="1"/> + <Setter Property="BorderBrush" Value="Transparent"/> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="Button"> - <Border x:Name="border" Width="{TemplateBinding Width}" Background="{TemplateBinding Background}" + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="Button"> + <Border x:Name="border" Width="{TemplateBinding Width}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0"> - <Label x:Name="label" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" + <Label x:Name="label" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="{TemplateBinding Foreground}" Content="{TemplateBinding Content}"/> - </Border> + </Border> - <ControlTemplate.Triggers> - <Trigger Property="IsMouseOver" Value="True"> - <Setter TargetName="border" Property="Background" Value="Gray"/> - </Trigger> - </ControlTemplate.Triggers> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> + <ControlTemplate.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Setter TargetName="border" Property="Background" Value="Gray"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> - <Style x:Key="WindowCloseButton" BasedOn="{StaticResource WindowButton}" TargetType="Button"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="Button"> - <Border x:Name="border" Width="{TemplateBinding Width}" Background="{TemplateBinding Background}" + <Style x:Key="WindowCloseButton" BasedOn="{StaticResource WindowButton}" TargetType="Button"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="Button"> + <Border x:Name="border" Width="{TemplateBinding Width}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0"> - <Label x:Name="label" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" + <Label x:Name="label" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="{TemplateBinding Foreground}" Content="{TemplateBinding Content}"/> - </Border> + </Border> - <ControlTemplate.Triggers> - <Trigger Property="IsMouseOver" Value="True"> - <Setter TargetName="border" Property="Background" Value="Red"/> - </Trigger> - </ControlTemplate.Triggers> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> + <ControlTemplate.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Setter TargetName="border" Property="Background" Value="Red"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> - <Style x:Key="ChildWindowButton" BasedOn="{StaticResource WindowButton}" TargetType="Button"> - <Setter Property="FontSize" Value="15"/> - <Setter Property="Width" Value="30"/> - <Setter Property="Background" Value="{StaticResource ChildBorder}"/> - </Style> + <Style x:Key="ChildWindowButton" BasedOn="{StaticResource WindowButton}" TargetType="Button"> + <Setter Property="FontSize" Value="15"/> + <Setter Property="Width" Value="30"/> + <Setter Property="Background" Value="{StaticResource ChildBorder}"/> + </Style> - <Style x:Key="ChildWindowCloseButton" BasedOn="{StaticResource ChildWindowButton}" TargetType="Button"> - - </Style> + <Style x:Key="ChildWindowCloseButton" BasedOn="{StaticResource ChildWindowButton}" TargetType="Button"> - <Style x:Key="LinkButton" TargetType="Button"> - <Setter Property="FontFamily" Value="{StaticResource iconfont}"/> - <Setter Property="Foreground" Value="{StaticResource ChildBorder}"/> + </Style> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="Button"> - <TextBlock Style="{x:Null}" x:Name="label" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" + <Style x:Key="LinkButton" TargetType="Button"> + <Setter Property="FontFamily" Value="{StaticResource iconfont}"/> + <Setter Property="Foreground" Value="{StaticResource ChildBorder}"/> + + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="Button"> + <TextBlock Style="{x:Null}" x:Name="label" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}"/> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </ResourceDictionary> </Window.Resources> - - + + <StackPanel> - <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right"> - <Button Style="{StaticResource WindowButton}" Click="Button_Click">鍒锋柊</Button> - <Button Style="{StaticResource WindowButton}" Click="Button_Click">鍒囨崲鐢ㄦ埛</Button> - <Button Style="{StaticResource WindowCloseButton}" Click="Hide_Click">鏈�灏忓寲</Button> - </StackPanel> - <Grid> - <Button Click="Button_Click">娴嬭瘯</Button> - </Grid> + <Border BorderThickness="0" Background="LightGray"> + <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right"> + <Button Style="{StaticResource WindowButton}" Click="Refresh_Click" BorderBrush="Black" ToolTip="鍒锋柊"></Button> + <Button Style="{StaticResource WindowButton}" Click="SwitchUser_Click" ToolTip="鍒囨崲鐢ㄦ埛"></Button> + <Button Style="{StaticResource WindowCloseButton}" Click="Hide_Click" ToolTip="鏈�灏忓寲"></Button> + </StackPanel> + </Border> + + + <Label Content="{Binding messageTitle}"/> + + <ListView ItemsSource="{Binding messages}"> + <ListView.ItemTemplate> + <DataTemplate> + <Label Content="999"/> + </DataTemplate> + </ListView.ItemTemplate> + </ListView> + </StackPanel> - + </Window> -- Gitblit v1.9.1