MainWindow.xaml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <Window x:Class="GeekDesk.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:GeekDesk"
  7. xmlns:uc="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
  8. mc:Ignorable="d"
  9. xmlns:cvt="clr-namespace:GeekDesk.Converts"
  10. xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
  11. x:Name="window"
  12. xmlns:hc="https://handyorg.github.io/handycontrol"
  13. Title="GeekDesk"
  14. d:DesignHeight="500" d:DesignWidth="700"
  15. WindowStyle="None"
  16. AllowsTransparency="True"
  17. Background="#00FFFFFF"
  18. OpacityMask ="White"
  19. ShowInTaskbar="False"
  20. Opacity="0"
  21. Deactivated="Window_Deactivated"
  22. SizeChanged="Window_SizeChanged"
  23. >
  24. <WindowChrome.WindowChrome>
  25. <WindowChrome CaptionHeight="0" ResizeBorderThickness="10"/>
  26. </WindowChrome.WindowChrome>
  27. <Window.Resources>
  28. <cvt:MenuWidthConvert x:Key="MenuWidthConvert"/>
  29. <cvt:OpcityConvert x:Key="OpcityConvert"/>
  30. <cvt:IntToCornerRadius x:Key="IntToCornerRadius"/>
  31. <cvt:DoubleToGridLength x:Key="DoubleToGridLength"/>
  32. </Window.Resources>
  33. <Border CornerRadius="{Binding AppConfig.PannelCornerRadius, Mode=TwoWay, Converter={StaticResource IntToCornerRadius}}" BorderThickness="0"
  34. Background="AliceBlue" LostFocus="App_LostFocus"
  35. Opacity="{Binding AppConfig.PannelOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}">
  36. <Border CornerRadius="{Binding AppConfig.PannelCornerRadius, Mode=TwoWay, Converter={StaticResource IntToCornerRadius}}" BorderThickness="0">
  37. <!--背景图片-->
  38. <Border.Background>
  39. <VisualBrush>
  40. <VisualBrush.Visual>
  41. <Grid ClipToBounds="True">
  42. <Image Source="{Binding AppConfig.BitmapImage}" Margin="-30" Opacity="{Binding AppConfig.BgOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}">
  43. <Image.Effect>
  44. <BlurEffect Radius="{Binding AppConfig.BlurValue}"/>
  45. </Image.Effect>
  46. </Image>
  47. </Grid>
  48. </VisualBrush.Visual>
  49. </VisualBrush>
  50. <!--<ImageBrush ImageSource="{Binding AppConfig.BitmapImage}" Opacity="{Binding AppConfig.BgOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}"></ImageBrush>-->
  51. </Border.Background>
  52. <Grid>
  53. <Grid.RowDefinitions>
  54. <RowDefinition Height="40" MouseMove="DragMove"></RowDefinition>
  55. <RowDefinition Height="*"></RowDefinition>
  56. </Grid.RowDefinitions>
  57. <Grid.ColumnDefinitions>
  58. <ColumnDefinition x:Name="LeftColumn" MinWidth="80" Width="{Binding AppConfig.MenuCardWidth, Mode=TwoWay, Converter={StaticResource DoubleToGridLength}}" MaxWidth="200"></ColumnDefinition>
  59. <ColumnDefinition Width="*"></ColumnDefinition>
  60. </Grid.ColumnDefinitions>
  61. <DockPanel Grid.Row="0" Grid.Column="0" MouseMove="DragMove">
  62. <DockPanel.Background>
  63. <SolidColorBrush Opacity="0.01"/>
  64. </DockPanel.Background>
  65. <Image Source="/Resource/Image/TitleLogo.png" Margin="10,0,0,0" Width="94" Height="30" HorizontalAlignment="Left"/>
  66. </DockPanel>
  67. <DockPanel Grid.Row="0" Grid.Column="2" MouseMove="DragMove">
  68. <DockPanel.Background>
  69. <SolidColorBrush Opacity="0.01"/>
  70. </DockPanel.Background>
  71. <hc:UniformSpacingPanel Spacing="0" Grid.ColumnSpan="4" HorizontalAlignment="Right" VerticalAlignment="Center">
  72. <Button Background="Transparent"
  73. BorderThickness="0"
  74. hc:IconElement.Geometry="M917.930667 512c0-57.6 36.181333-106.496 86.869333-125.952a505.429333 505.429333 0 0 0-55.210667-133.461333A134.826667 134.826667 0 0 1 771.413333 74.410667 507.733333 507.733333 0 0 0 637.952 19.2 135.168 135.168 0 0 1 512 106.069333 134.912 134.912 0 0 1 386.048 19.2 505.429333 505.429333 0 0 0 252.586667 74.410667c22.186667 49.749333 13.141333 109.824-27.562667 150.528a135.168 135.168 0 0 1-150.528 27.648 502.016 502.016 0 0 0-55.296 133.461333c50.688 19.626667 86.869333 68.437333 86.869333 125.952 0 57.6-36.181333 106.496-86.869333 125.952 12.117333 47.530667 30.72 92.330667 55.210667 133.461333a134.826667 134.826667 0 0 1 178.090666 178.176 507.733333 507.733333 0 0 0 133.546667 55.210667A135.168 135.168 0 0 1 512 917.930667c57.6 0 106.496 36.181333 125.952 86.869333a505.429333 505.429333 0 0 0 133.461333-55.210667 134.912 134.912 0 0 1 27.562667-150.528 135.168 135.168 0 0 1 150.528-27.648 502.016 502.016 0 0 0 55.296-133.461333A134.912 134.912 0 0 1 917.930667 512zM512 647.338667a135.338667 135.338667 0 1 1 0.085333-270.762667A135.338667 135.338667 0 0 1 512 647.338667z"
  75. hc:IconElement.Height="18"
  76. hc:IconElement.Width="18"
  77. HorizontalAlignment="Right"
  78. Click="ConfigButtonClick"
  79. Initialized="SettingButton_Initialized"
  80. x:Name="SettingButton"
  81. >
  82. <Button.ContextMenu>
  83. <ContextMenu x:Name="SettingMenus" Width="130">
  84. <MenuItem Header="设置" Click="ConfigMenuClick"/>
  85. <MenuItem Header="待办" Click="BacklogMenuClick"/>
  86. </ContextMenu>
  87. </Button.ContextMenu>
  88. </Button>
  89. <Button Background="Transparent"
  90. BorderThickness="0"
  91. hc:IconElement.Geometry="M828.770654 148.714771C641.293737-20.89959 354.184117-19.590868 168.245698 152.630946c-212.062907 196.418185-212.062907 522.329912 0 718.748098 185.93842 172.221815 473.048039 173.520546 660.524956 3.916176 219.435707-198.536117 219.435707-528.054322 0-726.580449z m-121.880976 569.643707c-11.708566 11.708566-30.680039 11.708566-42.388605 0L502.729054 556.586459c-0.659356-0.659356-1.728312-0.659356-2.397659 0L338.609327 718.318517c-11.708566 11.708566-30.680039 11.708566-42.388605 0l-0.039961-0.039961c-11.708566-11.708566-11.708566-30.680039 0-42.388605l161.732059-161.732058c0.659356-0.659356 0.659356-1.728312 0-2.397659L296.1408 350.008195c-11.708566-11.708566-11.708566-30.680039 0-42.388605l0.039961-0.039961c11.708566-11.708566 30.680039-11.708566 42.388605 0l161.772019 161.77202c0.659356 0.659356 1.728312 0.659356 2.397659 0L664.551024 307.539668c11.708566-11.708566 30.680039-11.708566 42.388605 0l0.039961 0.039961c11.708566 11.708566 11.708566 30.680039 0 42.388605L545.15762 511.770224c-0.659356 0.659356-0.659356 1.728312 0 2.397659L706.919649 675.939902c11.708566 11.708566 11.708566 30.680039 0 42.388605l-0.029971 0.029971z"
  92. hc:IconElement.Height="18"
  93. hc:IconElement.Width="18"
  94. HorizontalAlignment="Right"
  95. Click="CloseButtonClick"
  96. />
  97. </hc:UniformSpacingPanel>
  98. </DockPanel>
  99. <uc:LeftCardControl Grid.Row="1" Grid.Column="0"/>
  100. <!--分割线-->
  101. <GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="1" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
  102. <uc:RightCardControl Grid.Row="1" Grid.Column="1"/>
  103. <hc:NotifyIcon Icon="/Taskbar.ico" Text="GeekDesk" Click="NotifyIcon_Click">
  104. <hc:NotifyIcon.ContextMenu>
  105. <ContextMenu Width="130">
  106. <MenuItem Header="打开面板" Click="ShowApp"/>
  107. <MenuItem Header="待办" Click="BacklogMenuClick"/>
  108. <MenuItem Header="程序目录" Click="OpenThisDir"/>
  109. <MenuItem Header="设置" Click="ConfigApp"/>
  110. <MenuItem Header="重启" Click="ReStartApp"/>
  111. <MenuItem Header="退出" Click="ExitApp"/>
  112. </ContextMenu>
  113. </hc:NotifyIcon.ContextMenu>
  114. </hc:NotifyIcon>
  115. <StackPanel hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,0"/>
  116. </Grid>
  117. </Border>
  118. </Border>
  119. </Window>