🎉 添加新手引导提示
This commit is contained in:
263
MainWindow.xaml
263
MainWindow.xaml
@@ -54,10 +54,81 @@
|
||||
</Window.CommandBindings>
|
||||
|
||||
<!--Opacity="{Binding AppConfig.PannelOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}"-->
|
||||
<Border Margin="20" CornerRadius="{Binding AppConfig.PannelCornerRadius, Mode=TwoWay, Converter={StaticResource IntToCornerRadius}}"
|
||||
<Grid>
|
||||
<!--遮罩层border 用于引导提示-->
|
||||
<Border Margin="20"
|
||||
MouseDown="DragMove"
|
||||
CornerRadius="{Binding AppConfig.PannelCornerRadius, Mode=OneWay, Converter={StaticResource IntToCornerRadius}}"
|
||||
BorderThickness="0"
|
||||
x:Name="GrayBorder"
|
||||
Panel.ZIndex="888"
|
||||
>
|
||||
<Border.Background>
|
||||
<SolidColorBrush Color="Gray" Opacity="0.8"/>
|
||||
</Border.Background>
|
||||
|
||||
<!--<hc:Poptip.Instance>
|
||||
<hc:Poptip PlacementType="Top" IsOpen="False" HitMode="None">
|
||||
<hc:Poptip.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<Border Background="White" Width="300" Height="150">
|
||||
<TextBlock Text="这是一个测测试"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</hc:Poptip.ContentTemplate>
|
||||
</hc:Poptip>
|
||||
</hc:Poptip.Instance>-->
|
||||
</Border>
|
||||
|
||||
<hc:Card x:Name="GuideCard" Width="300" Height="150" Panel.ZIndex="888"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Left">
|
||||
<!--Card 的内容部分-->
|
||||
<Border CornerRadius="4,4,0,0" Width="300" Height="100">
|
||||
<TextBlock TextWrapping="Wrap"
|
||||
x:Name="GuideText"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="将文件拖动到这里自动创建快捷方式, 或者鼠标右键单击添加系统项目"/>
|
||||
</Border>
|
||||
<!--Card 的尾部部分-->
|
||||
<hc:Card.Footer>
|
||||
<Grid>
|
||||
<StackPanel Margin="10" Width="150" Height="50" HorizontalAlignment="Left">
|
||||
<!--Card 的一级内容-->
|
||||
<TextBlock TextWrapping="Wrap"
|
||||
x:Name="GuideTitle1"
|
||||
Style="{DynamicResource TextBlockLargeBold}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Text="引导1"
|
||||
FontSize="20"
|
||||
HorizontalAlignment="Left"/>
|
||||
<!--Card 的二级内容-->
|
||||
<TextBlock TextWrapping="NoWrap"
|
||||
x:Name="GuideTitle2"
|
||||
Style="{DynamicResource TextBlockDefault}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Text="快捷方式创建"
|
||||
Margin="0,6,0,0"
|
||||
FontSize="14"
|
||||
HorizontalAlignment="Left"/>
|
||||
</StackPanel>
|
||||
<hc:UniformSpacingPanel HorizontalAlignment="Right">
|
||||
<Button x:Name="PreviewGuideBtn" Click="PreviewGuideBtn_Click" Margin="0,0,20,0" Content="上一步"/>
|
||||
<Button x:Name="NextGuideBtn" Click="NextGuideBtn_Click" Margin="0,0,20,0" Content="下一步"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
</Grid>
|
||||
</hc:Card.Footer>
|
||||
</hc:Card>
|
||||
|
||||
|
||||
<Border Margin="20" CornerRadius="{Binding AppConfig.PannelCornerRadius, Mode=TwoWay, Converter={StaticResource IntToCornerRadius}}"
|
||||
BorderThickness="0"
|
||||
Focusable="True"
|
||||
Panel.ZIndex="1"
|
||||
x:Name="BGBorder"
|
||||
Background="AliceBlue"
|
||||
hc:Dialog.Token="MainWindowDialog"
|
||||
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=None}"
|
||||
xf:Animations.PrimaryBinding="{Binding AppConfig.IsShow, Mode=OneWay}"
|
||||
@@ -66,45 +137,45 @@
|
||||
xf:Animations.SecondaryCompletionCommand="{Binding HideCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
|
||||
xf:Animations.AllowOpacityReset="False"
|
||||
>
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="30" Direction="-90" Color="Gray"
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="30" Direction="-90" Color="Gray"
|
||||
RenderingBias="Quality" ShadowDepth="2"/>
|
||||
</Border.Effect>
|
||||
<hc:DialogContainer Focusable="True">
|
||||
<Grid>
|
||||
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" MouseMove="DragMove"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition x:Name="LeftColumn" MinWidth="80" Width="{Binding AppConfig.MenuCardWidth, Mode=TwoWay, Converter={StaticResource DoubleToGridLength}}" MaxWidth="200"></ColumnDefinition>
|
||||
<ColumnDefinition x:Name="RightColumn" Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
</Border.Effect>
|
||||
<hc:DialogContainer Focusable="True">
|
||||
<Grid>
|
||||
|
||||
|
||||
<CheckBox x:Name="ShowBox" Visibility="Hidden" Panel.ZIndex="2"/>
|
||||
<CheckBox x:Name="HideBox" Visibility="Hidden" Panel.ZIndex="2"/>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" MouseDown="DragMove"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition x:Name="LeftColumn" MinWidth="80" Width="{Binding AppConfig.MenuCardWidth, Mode=TwoWay, Converter={StaticResource DoubleToGridLength}}" MaxWidth="200"></ColumnDefinition>
|
||||
<ColumnDefinition x:Name="RightColumn" Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel HorizontalAlignment="Right" Panel.ZIndex="99" hc:Growl.GrowlParent="False" hc:Growl.Token="MainWindowGrowl" Grid.Column="1" Grid.Row="1"/>
|
||||
<StackPanel HorizontalAlignment="Center" Panel.ZIndex="99" hc:Growl.GrowlParent="False" hc:Growl.Token="MainWindowAskGrowl" Grid.Column="1" Grid.Row="1"/>
|
||||
|
||||
<DockPanel Grid.Row="0" Grid.Column="0" MouseMove="DragMove">
|
||||
<DockPanel.Background>
|
||||
<SolidColorBrush Opacity="0.01"/>
|
||||
</DockPanel.Background>
|
||||
<Image Visibility="{Binding AppConfig.TitleLogoVisible}" Source="/Resource/Image/TitleLogo.png" RenderOptions.BitmapScalingMode="HighQuality" Margin="10,0,0,0" Width="200" Height="30" HorizontalAlignment="Left"/>
|
||||
</DockPanel>
|
||||
|
||||
<DockPanel Grid.Row="0" Grid.Column="2" MouseMove="DragMove">
|
||||
<DockPanel.Background>
|
||||
<SolidColorBrush Opacity="0.01"/>
|
||||
</DockPanel.Background>
|
||||
<hc:UniformSpacingPanel Grid.ColumnSpan="4" HorizontalAlignment="Right" VerticalAlignment="Center">
|
||||
<Button Background="Transparent"
|
||||
|
||||
<CheckBox x:Name="ShowBox" Visibility="Hidden" Panel.ZIndex="2"/>
|
||||
<CheckBox x:Name="HideBox" Visibility="Hidden" Panel.ZIndex="2"/>
|
||||
|
||||
<StackPanel HorizontalAlignment="Right" Panel.ZIndex="99" hc:Growl.GrowlParent="False" hc:Growl.Token="MainWindowGrowl" Grid.Column="1" Grid.Row="1"/>
|
||||
<StackPanel HorizontalAlignment="Center" Panel.ZIndex="99" hc:Growl.GrowlParent="False" hc:Growl.Token="MainWindowAskGrowl" Grid.Column="1" Grid.Row="1"/>
|
||||
|
||||
<DockPanel Grid.Row="0" Grid.Column="0" MouseDown="DragMove">
|
||||
<DockPanel.Background>
|
||||
<SolidColorBrush Opacity="0.01"/>
|
||||
</DockPanel.Background>
|
||||
<Image Visibility="{Binding AppConfig.TitleLogoVisible}" Source="/Resource/Image/TitleLogo.png" RenderOptions.BitmapScalingMode="HighQuality" Margin="10,0,0,0" Width="200" Height="30" HorizontalAlignment="Left"/>
|
||||
</DockPanel>
|
||||
|
||||
<DockPanel Grid.Row="0" Grid.Column="2" MouseDown="DragMove">
|
||||
<DockPanel.Background>
|
||||
<SolidColorBrush Opacity="0.01"/>
|
||||
</DockPanel.Background>
|
||||
<hc:UniformSpacingPanel Grid.ColumnSpan="4" HorizontalAlignment="Right" VerticalAlignment="Center">
|
||||
<Button Background="Transparent"
|
||||
BorderThickness="0"
|
||||
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"
|
||||
hc:IconElement.Height="18"
|
||||
@@ -116,14 +187,14 @@
|
||||
x:Name="SettingButton"
|
||||
FocusVisualStyle="{x:Null}"
|
||||
>
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu x:Name="SettingMenus" Width="130">
|
||||
<MenuItem Header="设置" Click="ConfigMenuClick"/>
|
||||
<MenuItem Header="待办" Click="BacklogMenuClick"/>
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
</Button>
|
||||
<Button Background="Transparent"
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu x:Name="SettingMenus" Width="130">
|
||||
<MenuItem Header="设置" Click="ConfigMenuClick"/>
|
||||
<MenuItem Header="待办" Click="BacklogMenuClick"/>
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
</Button>
|
||||
<Button Background="Transparent"
|
||||
BorderThickness="0"
|
||||
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"
|
||||
hc:IconElement.Height="18"
|
||||
@@ -133,16 +204,16 @@
|
||||
PreviewMouseLeftButtonDown="AppButton_PreviewMouseLeftButtonDown"
|
||||
FocusVisualStyle="{x:Null}"
|
||||
/>
|
||||
</hc:UniformSpacingPanel>
|
||||
</DockPanel>
|
||||
</hc:UniformSpacingPanel>
|
||||
</DockPanel>
|
||||
|
||||
|
||||
<uc:LeftCardControl x:Name="LeftCard" Grid.Row="1" Grid.Column="0"/>
|
||||
<uc:LeftCardControl x:Name="LeftCard" Grid.Row="1" Grid.Column="0"/>
|
||||
|
||||
<!--分割线-->
|
||||
<GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="1" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
|
||||
<!--分割线-->
|
||||
<GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="1" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
|
||||
|
||||
<Border x:Name="SearchResContainer" Panel.ZIndex="2"
|
||||
<Border x:Name="SearchResContainer" Panel.ZIndex="2"
|
||||
Visibility="Collapsed"
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
HorizontalAlignment="Right" MaxWidth="200"
|
||||
@@ -150,29 +221,29 @@
|
||||
CornerRadius="8"
|
||||
Margin="0,20,40,0"
|
||||
>
|
||||
<Border.Style>
|
||||
<Style TargetType="Border" >
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="White" Opacity="0.6"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="MaxWidth" Value="300"/>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<WrapPanel Margin="8">
|
||||
<TextBlock Opacity="0.6" Text="g:"/>
|
||||
<TextBlock x:Name="GeekDeskSearchTotal" Opacity="0.6" Text="0"/>
|
||||
<TextBlock Opacity="0.6" Text="+"/>
|
||||
<TextBlock Opacity="0.6" Text="e:"/>
|
||||
<TextBlock x:Name="EverythingSearchCount" Opacity="0.6" Text="0"/>
|
||||
<TextBlock Opacity="0.6" Text=" of "/>
|
||||
<TextBlock x:Name="EverythingSearchTotal" Opacity="0.6" Text="0"/>
|
||||
</WrapPanel>
|
||||
</Border>
|
||||
|
||||
<!--搜索输入框-->
|
||||
<TextBox Panel.ZIndex="2" Grid.Row="0" Grid.Column="1"
|
||||
<Border.Style>
|
||||
<Style TargetType="Border" >
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="White" Opacity="0.6"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="MaxWidth" Value="300"/>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<WrapPanel Margin="8">
|
||||
<TextBlock Opacity="0.6" Text="g:"/>
|
||||
<TextBlock x:Name="GeekDeskSearchTotal" Opacity="0.6" Text="0"/>
|
||||
<TextBlock Opacity="0.6" Text="+"/>
|
||||
<TextBlock Opacity="0.6" Text="e:"/>
|
||||
<TextBlock x:Name="EverythingSearchCount" Opacity="0.6" Text="0"/>
|
||||
<TextBlock Opacity="0.6" Text=" of "/>
|
||||
<TextBlock x:Name="EverythingSearchTotal" Opacity="0.6" Text="0"/>
|
||||
</WrapPanel>
|
||||
</Border>
|
||||
|
||||
<!--搜索输入框-->
|
||||
<TextBox Panel.ZIndex="2" Grid.Row="0" Grid.Column="1"
|
||||
x:Name="SearchBox"
|
||||
Width="0"
|
||||
Margin="-100,5,0,0"
|
||||
@@ -181,35 +252,37 @@
|
||||
BorderThickness="0"
|
||||
TextChanged="SearchBox_TextChanged"
|
||||
>
|
||||
<TextBox.Background>
|
||||
<SolidColorBrush Color="White" Opacity="0.5" />
|
||||
</TextBox.Background>
|
||||
</TextBox>
|
||||
<TextBox.Background>
|
||||
<SolidColorBrush Color="White" Opacity="0.5" />
|
||||
</TextBox.Background>
|
||||
</TextBox>
|
||||
|
||||
|
||||
<hc:NotifyIcon Icon="/Logo.ico" Click="NotifyIcon_Click" x:Name="BarIcon"
|
||||
<hc:NotifyIcon Icon="/Logo.ico" Click="NotifyIcon_Click" x:Name="BarIcon"
|
||||
Visibility="{Binding AppConfig.ShowBarIcon, Mode=TwoWay, Converter={StaticResource Boolean2VisibilityConverter}}">
|
||||
<hc:NotifyIcon.ContextMenu>
|
||||
<ContextMenu Width="130" x:Name="TaskbarContextMenu">
|
||||
<MenuItem Header="打开面板" Click="ShowApp"/>
|
||||
<MenuItem Header="拾色器" Click="ColorPicker"/>
|
||||
<MenuItem Header="备份" Click="BakDataFile"/>
|
||||
<MenuItem Header="隐藏图标" Click="CloseBarIcon"/>
|
||||
<MenuItem Header="待办" Click="BacklogMenuClick"/>
|
||||
<MenuItem Header="程序目录" Click="OpenThisDir"/>
|
||||
<MenuItem Header="设置" Click="ConfigApp"/>
|
||||
<MenuItem Header="重启" Click="ReStartApp"/>
|
||||
<MenuItem Header="退出" Click="ExitApp"/>
|
||||
</ContextMenu>
|
||||
</hc:NotifyIcon.ContextMenu>
|
||||
</hc:NotifyIcon>
|
||||
<hc:NotifyIcon.ContextMenu>
|
||||
<ContextMenu Width="130" x:Name="TaskbarContextMenu">
|
||||
<MenuItem Header="打开面板" Click="ShowApp"/>
|
||||
<MenuItem Header="拾色器" Click="ColorPicker"/>
|
||||
<MenuItem Header="备份" Click="BakDataFile"/>
|
||||
<MenuItem Header="隐藏图标" Click="CloseBarIcon"/>
|
||||
<MenuItem Header="待办" Click="BacklogMenuClick"/>
|
||||
<MenuItem Header="程序目录" Click="OpenThisDir"/>
|
||||
<MenuItem Header="设置" Click="ConfigApp"/>
|
||||
<MenuItem Header="重启" Click="ReStartApp"/>
|
||||
<MenuItem Header="退出" Click="ExitApp"/>
|
||||
</ContextMenu>
|
||||
</hc:NotifyIcon.ContextMenu>
|
||||
</hc:NotifyIcon>
|
||||
|
||||
<uc:RightCardControl x:Name="RightCard" Grid.Row="1" Grid.Column="1"/>
|
||||
<uc:RightCardControl x:Name="RightCard" Grid.Row="1" Grid.Column="1"/>
|
||||
|
||||
|
||||
<StackPanel hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,0"/>
|
||||
</Grid>
|
||||
</hc:DialogContainer>
|
||||
</Border>
|
||||
<StackPanel hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,0"/>
|
||||
</Grid>
|
||||
</hc:DialogContainer>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Window>
|
||||
|
||||
@@ -17,6 +17,7 @@ using ShowSeconds;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@@ -24,8 +25,10 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Media.Media3D;
|
||||
using System.Windows.Shell;
|
||||
using System.Windows.Threading;
|
||||
using static GeekDesk.Util.ShowWindowFollowMouse;
|
||||
@@ -50,7 +53,6 @@ namespace GeekDesk
|
||||
//加载数据
|
||||
LoadData();
|
||||
InitializeComponent();
|
||||
|
||||
//用于其他类访问
|
||||
mainWindow = this;
|
||||
|
||||
@@ -355,8 +357,13 @@ namespace GeekDesk
|
||||
Keyboard.Focus(SearchBox);
|
||||
|
||||
MessageUtil.ChangeWindowMessageFilter(MessageUtil.WM_COPYDATA, 1);
|
||||
|
||||
|
||||
Guide();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 注册当前窗口的热键
|
||||
/// </summary>
|
||||
@@ -497,28 +504,9 @@ namespace GeekDesk
|
||||
/// <param name="e"></param>
|
||||
private void DragMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
if (e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
var windowMode = this.ResizeMode;
|
||||
if (this.ResizeMode != ResizeMode.NoResize)
|
||||
{
|
||||
this.ResizeMode = ResizeMode.NoResize;
|
||||
}
|
||||
|
||||
this.UpdateLayout();
|
||||
|
||||
|
||||
/* 当点击拖拽区域的时候,让窗口跟着移动
|
||||
(When clicking the drag area, make the window follow) */
|
||||
DragMove();
|
||||
|
||||
if (this.ResizeMode != windowMode)
|
||||
{
|
||||
this.ResizeMode = windowMode;
|
||||
}
|
||||
|
||||
this.UpdateLayout();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1028,5 +1016,133 @@ namespace GeekDesk
|
||||
|
||||
|
||||
|
||||
class GuideInfo
|
||||
{
|
||||
private string title1;
|
||||
private string title2;
|
||||
private string guideText;
|
||||
|
||||
public string Title1 { get; set; }
|
||||
public string Title2 { get; set; }
|
||||
public string GuideText { get; set; }
|
||||
}
|
||||
enum GuidePopOffect
|
||||
{
|
||||
TOP,
|
||||
INNER_TOP,
|
||||
LEFT,
|
||||
INNER_LEFT,
|
||||
CENTER,
|
||||
RIGHT,
|
||||
INNER_RIGHT,
|
||||
BOTTOM,
|
||||
INNER_BOTTOM
|
||||
}
|
||||
|
||||
private ObservableCollection<GuideInfo> list = new ObservableCollection<GuideInfo>();
|
||||
|
||||
private void Guide()
|
||||
{
|
||||
|
||||
GuideInfo guideInfo = new GuideInfo
|
||||
{
|
||||
Title1 = "提示1",
|
||||
Title2 = "快捷方式创建",
|
||||
GuideText = "将文件拖动到这里自动创建快捷方式, 或者鼠标右键单击添加系统项目"
|
||||
};
|
||||
list.Add(guideInfo);
|
||||
|
||||
guideInfo = new GuideInfo
|
||||
{
|
||||
Title1 = "提示2",
|
||||
Title2 = "快捷方式创建",
|
||||
GuideText = "将文件拖动到这里自动创建快捷方式, 或者鼠标右键单击添加系统项目"
|
||||
};
|
||||
list.Add(guideInfo);
|
||||
|
||||
guideInfo = new GuideInfo
|
||||
{
|
||||
Title1 = "提示3",
|
||||
Title2 = "快捷方式创建",
|
||||
GuideText = "将文件拖动到这里自动创建快捷方式, 或者鼠标右键单击添加系统项目"
|
||||
};
|
||||
list.Add(guideInfo);
|
||||
|
||||
GrayBorder.Visibility = Visibility.Visible;
|
||||
GuideSwitch(0);
|
||||
GuideCard.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
private void GuideSwitch(int num)
|
||||
{
|
||||
switch (num)
|
||||
{
|
||||
default: //0 //右侧列表区域
|
||||
PreviewGuideBtn.Visibility = Visibility.Collapsed;
|
||||
NextGuideBtn.Content = "下一步";
|
||||
Point point = RightCard.TransformToAncestor(this).Transform(new Point(0, 0));
|
||||
//内部中上
|
||||
GrayBoderClip(point.X, point.Y, RightCard.ActualWidth, RightCard.ActualHeight,
|
||||
new Thickness(point.X + RightCard.ActualWidth / 2 - GuideCard.ActualWidth / 2, point.Y, 0, 0));
|
||||
break;
|
||||
case 1: //左侧菜单
|
||||
PreviewGuideBtn.Visibility = Visibility.Visible;
|
||||
NextGuideBtn.Content = "下一步";
|
||||
Point leftCardPoint = LeftCard.TransformToAncestor(this).Transform(new Point(0, 0));
|
||||
GrayBoderClip(leftCardPoint.X , leftCardPoint.Y , LeftCard.ActualWidth, LeftCard.ActualHeight,
|
||||
// 外部中下侧
|
||||
new Thickness(leftCardPoint.X + LeftCard.ActualWidth,
|
||||
leftCardPoint.Y + LeftCard.ActualHeight / 2 - GuideCard.ActualHeight / 2, 0, 0));
|
||||
break;
|
||||
case 2: //头部拖拽栏
|
||||
NextGuideBtn.Content = "完成";
|
||||
GrayBoderClip(0, 0, this.Width, 50,
|
||||
// 外部中下侧
|
||||
new Thickness(this.Width / 2 - GuideCard.ActualWidth / 2, 50, 0, 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void GrayBoderClip(double x, double y, double w, double h, Thickness margin)
|
||||
{
|
||||
PathGeometry borGeometry = new PathGeometry();
|
||||
|
||||
RectangleGeometry rg = new RectangleGeometry();
|
||||
rg.Rect = new Rect(0, 0, this.Width, this.Height);
|
||||
borGeometry = Geometry.Combine(borGeometry, rg, GeometryCombineMode.Union, null);
|
||||
GrayBorder.Clip = borGeometry;
|
||||
|
||||
RectangleGeometry rg1 = new RectangleGeometry();
|
||||
rg1.Rect = new Rect(x - 20, y - 20, w, h);
|
||||
borGeometry = Geometry.Combine(borGeometry, rg1, GeometryCombineMode.Exclude, null);
|
||||
GuideCard.Margin = margin;
|
||||
GrayBorder.Clip = borGeometry;
|
||||
}
|
||||
|
||||
private void PreviewGuideBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
int index = Convert.ToInt32(GuideTitle1.Text.ToString().Substring(2)) - 1;
|
||||
int previewIndex = index - 1;
|
||||
GuideTitle1.Text = list[previewIndex].Title1;
|
||||
GuideTitle2.Text = list[previewIndex].Title2;
|
||||
GuideText.Text = list[previewIndex].GuideText;
|
||||
GuideSwitch(previewIndex);
|
||||
}
|
||||
|
||||
private void NextGuideBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if ("完成".Equals(NextGuideBtn.Content.ToString())) {
|
||||
GrayBorder.Visibility = Visibility.Collapsed;
|
||||
GuideCard.Visibility = Visibility.Collapsed;
|
||||
return;
|
||||
}
|
||||
int index = Convert.ToInt32(GuideTitle1.Text.ToString().Substring(2)) - 1;
|
||||
int nextIndex = index + 1;
|
||||
GuideTitle1.Text = list[nextIndex].Title1;
|
||||
GuideTitle2.Text = list[nextIndex].Title2;
|
||||
GuideText.Text = list[nextIndex].GuideText;
|
||||
GuideSwitch(nextIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace GeekDesk.Util
|
||||
else
|
||||
{
|
||||
LinearGradientBrush lgb = new LinearGradientBrush();
|
||||
lgb.Opacity = (double)(Math.Round((decimal)(appConfig.BgOpacity / 100.00), 2));
|
||||
GradientStop gs = new GradientStop
|
||||
{
|
||||
Color = (Color)ColorConverter.ConvertFromString(appConfig.GradientBGParam.Color1),
|
||||
@@ -60,6 +59,7 @@ namespace GeekDesk.Util
|
||||
Offset = 1
|
||||
};
|
||||
lgb.GradientStops.Add(gs2);
|
||||
lgb.Opacity = (double)(Math.Round((decimal)(appConfig.BgOpacity / 100.00), 2));
|
||||
MainWindow.mainWindow.BGBorder.Background = lgb;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user