MainWindow.xaml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <Window x:Class="GDNXFD.Alert.Config.Views.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:controls="clr-namespace:GDNXFD.Alert.Config.Controls"
  5. xmlns:view="clr-namespace:GDNXFD.Alert.Config.Views"
  6. Title="自定义报警配置" Height="240" Width="500"
  7. Closing="Window_Closing" Background="{x:Null}"
  8. Icon="/Resources/Images/favicon.ico"
  9. WindowState="Normal" WindowStartupLocation="CenterScreen"
  10. WindowStyle="None" BorderThickness="0" Style="{x:Null}"
  11. AllowsTransparency="True"
  12. MinWidth="500" MinHeight="240">
  13. <Window.Resources>
  14. <Style x:Key="CycleButtonStyle2" TargetType="RadioButton" >
  15. <Setter Property="Template">
  16. <Setter.Value>
  17. <ControlTemplate TargetType="{x:Type RadioButton}">
  18. <Border x:Name="bdr_main" Background="DeepSkyBlue" BorderThickness="1" BorderBrush="LightGray">
  19. <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content" />
  20. </Border>
  21. <ControlTemplate.Triggers>
  22. <Trigger Property="IsMouseOver" Value="True">
  23. <Setter TargetName="bdr_main" Property="Opacity" Value="0.5"/>
  24. </Trigger>
  25. <Trigger Property="IsChecked" Value="True">
  26. <Setter TargetName="bdr_main" Property="Background" Value="LightBlue"/>
  27. </Trigger>
  28. </ControlTemplate.Triggers>
  29. </ControlTemplate>
  30. </Setter.Value>
  31. </Setter>
  32. <Setter Property="Width" Value="100" />
  33. <Setter Property="Height" Value="40" />
  34. <Setter Property="FontSize" Value="16" />
  35. <Setter Property="HorizontalAlignment" Value="Center" />
  36. <Setter Property="VerticalAlignment" Value="Center" />
  37. <Setter Property="SnapsToDevicePixels" Value="True" />
  38. </Style>
  39. </Window.Resources>
  40. <Grid>
  41. <Border CornerRadius="8,8,8,8" Background="{StaticResource module-background-color-brush }" Height="Auto">
  42. <Grid>
  43. <Grid.ColumnDefinitions>
  44. <ColumnDefinition Width="10px"></ColumnDefinition>
  45. <ColumnDefinition Width="402px"></ColumnDefinition>
  46. <ColumnDefinition ></ColumnDefinition>
  47. <ColumnDefinition Width="50px"></ColumnDefinition>
  48. <ColumnDefinition Width="10px"></ColumnDefinition>
  49. </Grid.ColumnDefinitions>
  50. <Grid.RowDefinitions>
  51. <RowDefinition Height="60px"></RowDefinition>
  52. <RowDefinition Height="*"></RowDefinition>
  53. </Grid.RowDefinitions>
  54. <!--顶部区域,支持鼠标拖放,最大化和还原,类似于传统窗口的标题栏-->
  55. <Border Grid.Row="0" Grid.ColumnSpan="5" Margin="0" Height="60" VerticalAlignment="Top" Background="#00FFFFFF" MouseLeftButtonDown="MainWindow_MouseLeftButtonDown"></Border>
  56. <!--标题栏的三按钮:最小化、最大化(恢复)、关闭-->
  57. <Grid Grid.Row="0" Grid.ColumnSpan="4">
  58. <Grid.ColumnDefinitions>
  59. <ColumnDefinition Width="*"/>
  60. <ColumnDefinition Width="Auto"/>
  61. </Grid.ColumnDefinitions>
  62. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Column="1" Margin="0,5,0,0" VerticalAlignment="Top" Height="20">
  63. <Button Click="MinimizeButton" Style="{StaticResource MinimizeButtonStyle}" ToolTip="{Binding Tooltip_minimize, Source={StaticResource Provider}, Mode=OneWay}" Width="10" Margin="0,2,12,0" VerticalAlignment="Top"></Button>
  64. <Button Click="MaximizeButton" Style="{StaticResource MaximizeButtonStyle}" ToolTip="{Binding Tooltip_restore, Source={StaticResource Provider}, Mode=OneWay}" Width="18" Margin="0,2,10,0" ></Button>
  65. <Button Click="CloseButton" Style="{StaticResource CloseButtonStyle}" ToolTip="{Binding Tooltip_close, Source={StaticResource Provider}, Mode=OneWay}" Height="15" ></Button>
  66. </StackPanel>
  67. </Grid>
  68. <!--功能导航: 自定义报警、 DI点报警--><!--
  69. <StackPanel Grid.Row="0" Grid.Column="2" Orientation="Horizontal"
  70. Visibility="{Binding IsLogin, Converter={StaticResource BooleanToVisibilityConverter}}"
  71. HorizontalAlignment="Left" VerticalAlignment="Bottom" x:Name="pnlNav">
  72. <RadioButton Style="{StaticResource CycleButtonStyle2}" Margin="10 0 0 0"
  73. Content="自定义报警" IsChecked="True" x:Name="rbtnCustom"
  74. GroupName="g2" Checked="rbtnCustom_Checked" >
  75. </RadioButton>
  76. <RadioButton Style="{StaticResource CycleButtonStyle2}" Content="开关量报警"
  77. GroupName="g2" x:Name="rbtnDI" Checked="rbtnDI_Checked" >
  78. </RadioButton>
  79. </StackPanel>-->
  80. <Image Grid.Row="0" Grid.Column="1" IsHitTestVisible="False" IsEnabled="False" Source="/Resources/Images/logo.png" Stretch="Uniform" Margin="5,9,0,8"></Image>
  81. <!-- 当前用户 -->
  82. <Grid Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="2" >
  83. <Grid.ColumnDefinitions>
  84. <ColumnDefinition Width="*"/>
  85. <ColumnDefinition Width="Auto"/>
  86. </Grid.ColumnDefinitions>
  87. <StackPanel Visibility="{Binding IsLogin, Converter={StaticResource BooleanToVisibilityConverter}}"
  88. HorizontalAlignment="Right" Orientation="Horizontal" Grid.Column="1" Margin="0,25,0,0" VerticalAlignment="Top" Height="25">
  89. <Image IsEnabled="False" Source="/Resources/Images/user.png" Width="18" Height="20" Stretch="Uniform" Margin="0,0,5,0"></Image>
  90. <TextBlock Text="{Binding Username}" Style="{StaticResource UserNameStyle}" ></TextBlock>
  91. </StackPanel>
  92. </Grid>
  93. <!--数据区域-->
  94. <ScrollViewer Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="4" VerticalScrollBarVisibility="Auto" Margin="0,0,5,0">
  95. <Grid x:Name="PARTContentHost" Margin="5,0,10,0" Focusable="False">
  96. </Grid>
  97. </ScrollViewer>
  98. <!--显示忙碌状态-->
  99. <Grid Grid.ColumnSpan="5" Grid.RowSpan="2"
  100. Visibility="{Binding IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}">
  101. <controls:LoadingControl></controls:LoadingControl>
  102. </Grid>
  103. <!--显示确认对话框-->
  104. <Grid Grid.ColumnSpan="5" Grid.RowSpan="2"
  105. Visibility="{Binding IsVisibleDialog, Converter={StaticResource BooleanToVisibilityConverter}}" >
  106. <controls:CustomDialog DataContext="{Binding DialogMessage}"></controls:CustomDialog>
  107. </Grid>
  108. </Grid>
  109. </Border>
  110. </Grid>
  111. </Window>