添加自定义菜单图标
This commit is contained in:
43
Control/Other/CustomIconUrlDialog.xaml
Normal file
43
Control/Other/CustomIconUrlDialog.xaml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<Border x:Class="GeekDesk.Control.Other.CustomIconUrlDialog"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
|
CornerRadius="3"
|
||||||
|
Width="400"
|
||||||
|
Height="230"
|
||||||
|
Opacity="0.95">
|
||||||
|
<Border.Resources>
|
||||||
|
<Style x:Key="LeftTB" TargetType="TextBlock" BasedOn="{StaticResource TextBlockBaseStyle}">
|
||||||
|
<Setter Property="Width" Value="100"/>
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="FontSize" Value="14"/>
|
||||||
|
</Style>
|
||||||
|
</Border.Resources>
|
||||||
|
<Border.Background>
|
||||||
|
<SolidColorBrush Color="AliceBlue" Opacity="1"/>
|
||||||
|
</Border.Background>
|
||||||
|
<hc:SimplePanel Margin="10">
|
||||||
|
<Grid Margin="8,20,8,20">
|
||||||
|
|
||||||
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,-10">
|
||||||
|
<TextBlock Text="SVG 图标地址:" Style="{StaticResource LeftTB}"/>
|
||||||
|
<TextBox x:Name="IconUrl" Text="{Binding Name, Mode=OneWay}" Width="240" FontSize="14"/>
|
||||||
|
</hc:UniformSpacingPanel>
|
||||||
|
|
||||||
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,58.276,0,-58.276">
|
||||||
|
<TextBlock Text="JSON 配置地址:" Style="{StaticResource LeftTB}"/>
|
||||||
|
<TextBox x:Name="JsonUrl" Text="{Binding Name, Mode=OneWay}" Width="240" FontSize="14"/>
|
||||||
|
</hc:UniformSpacingPanel>
|
||||||
|
|
||||||
|
<!--<hc:UniformSpacingPanel Spacing="10" Margin="246.206,124.551,-246.206,-124.551">
|
||||||
|
<Button Content="取消" Click=""
|
||||||
|
/>
|
||||||
|
<Button Content="保存" Click=""
|
||||||
|
Background="#5BC0DE"
|
||||||
|
Foreground="White"/>
|
||||||
|
</hc:UniformSpacingPanel>-->
|
||||||
|
</Grid>
|
||||||
|
<!--<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>-->
|
||||||
|
</hc:SimplePanel>
|
||||||
|
</Border>
|
||||||
30
Control/Other/CustomIconUrlDialog.xaml.cs
Normal file
30
Control/Other/CustomIconUrlDialog.xaml.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using GeekDesk.Util;
|
||||||
|
using GeekDesk.ViewModel;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
|
|
||||||
|
namespace GeekDesk.Control.Other
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// TextDialog.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class CustomIconUrlDialog
|
||||||
|
{
|
||||||
|
|
||||||
|
public CustomIconUrlDialog(AppConfig appConfig)
|
||||||
|
{
|
||||||
|
this.DataContext = appConfig;
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomIconUrlDialog()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,12 +19,6 @@
|
|||||||
</Border.Background>
|
</Border.Background>
|
||||||
<hc:SimplePanel Margin="10">
|
<hc:SimplePanel Margin="10">
|
||||||
<Grid Margin="8,20,8,20">
|
<Grid Margin="8,20,8,20">
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="93*"/>
|
|
||||||
<ColumnDefinition Width="38*"/>
|
|
||||||
<ColumnDefinition Width="126*"/>
|
|
||||||
<ColumnDefinition Width="7*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
|
||||||
<TextBlock Text="名称:" Style="{StaticResource LeftTB}"/>
|
<TextBlock Text="名称:" Style="{StaticResource LeftTB}"/>
|
||||||
<TextBox x:Name="IconName" Text="{Binding Name, Mode=OneWay}" Width="180" FontSize="14"/>
|
<TextBox x:Name="IconName" Text="{Binding Name, Mode=OneWay}" Width="180" FontSize="14"/>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
||||||
xmlns:local="clr-namespace:GeekDesk.Control.UserControls"
|
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Background="AliceBlue"
|
Background="AliceBlue"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
>
|
>
|
||||||
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Top">
|
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||||
<ListBox x:Name="IconListBox" ItemsSource="{Binding iconListSystem}" SelectionChanged="ListBox_SelectionChanged" BorderThickness="0" Background="AliceBlue">
|
<ListBox x:Name="IconListBox" ItemsSource="{Binding}" BorderThickness="0" Background="AliceBlue">
|
||||||
<ListBox.ItemsPanel>
|
<ListBox.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<WrapPanel Orientation="Horizontal" Background="Transparent"/>
|
<WrapPanel Orientation="Horizontal" Background="Transparent"/>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ namespace GeekDesk.Control.UserControls.IconFont
|
|||||||
{
|
{
|
||||||
public IconPannel()
|
public IconPannel()
|
||||||
{
|
{
|
||||||
|
//DataContext = this;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel MouseLeftButtonDown="MenuClick" Tag="{Binding}">
|
<StackPanel MouseLeftButtonDown="MenuClick" MouseRightButtonDown="MenuClick" Tag="{Binding}">
|
||||||
<hc:TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
|
<hc:TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}}"
|
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}}"
|
||||||
@@ -119,27 +119,19 @@
|
|||||||
IsVisibleChanged="MenuEditWhenVisibilityChanged"
|
IsVisibleChanged="MenuEditWhenVisibilityChanged"
|
||||||
Visibility="{Binding MenuEdit}"/>
|
Visibility="{Binding MenuEdit}"/>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<!--<Button Background="Transparent"
|
<Button Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
hc:IconElement.Geometry="{StaticResource test}"
|
hc:IconElement.Geometry="{Binding MenuGeometry}"
|
||||||
hc:IconElement.Height="18"
|
hc:IconElement.Height="18"
|
||||||
hc:IconElement.Width="18"
|
hc:IconElement.Width="18"
|
||||||
/>-->
|
/>
|
||||||
<!--<Button Background="Transparent" BorderThickness="0" Height="10" Width="10">
|
<TextBlock Text="{Binding MenuName}"
|
||||||
<Canvas>
|
HorizontalAlignment="Center"
|
||||||
<Path Fill="#92E3C3" Data="M391.68 957.44h-66.56v-158.4128H66.56v-66.56h258.56v-174.08H66.56v-66.56h258.56V307.2h66.56l-0.0512 184.6272h240.6912V307.2h66.56l-0.0512 184.6272H957.44v307.2h-258.6112V957.44h-66.4576l-0.0512-158.4128H391.6288V957.44z m-0.0512-224.9728h240.6912v-174.08H391.6288v174.08z m565.8112-174.08h-258.6112v174.08H957.44v-174.08z"/>
|
TextAlignment="Center"
|
||||||
<Path Fill="#5D7092" Data="M51.2 51.2h921.6v256H51.2z"/>
|
VerticalAlignment="Center"
|
||||||
<Path Fill="#5D7092" Data="M921.6 0a102.4 102.4 0 0 1 102.4 102.4v819.2a102.4 102.4 0 0 1-102.4 102.4H102.4a102.4 102.4 0 0 1-102.4-102.4V102.4a102.4 102.4 0 0 1 102.4-102.4h819.2z m0 66.56H102.4a35.84 35.84 0 0 0-35.5328 30.976L66.56 102.4v819.2a35.84 35.84 0 0 0 30.976 35.5328L102.4 957.44h819.2a35.84 35.84 0 0 0 35.5328-30.976L957.44 921.6V102.4a35.84 35.84 0 0 0-30.976-35.5328L921.6 66.56z"/>
|
IsVisibleChanged="MenuWhenVisibilityChanged"
|
||||||
</Canvas>
|
Visibility="{Binding NotMenuEdit}"
|
||||||
</Button>-->
|
/>
|
||||||
<!--<TextBlock Text="" Style="{StaticResource MyIcon}"/>-->
|
|
||||||
<TextBlock Text="{Binding MenuName}"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
TextAlignment="Center"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
IsVisibleChanged="MenuWhenVisibilityChanged"
|
|
||||||
Visibility="{Binding NotMenuEdit}"
|
|
||||||
/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|||||||
@@ -3,21 +3,14 @@ using GeekDesk.Control.Windows;
|
|||||||
using GeekDesk.Util;
|
using GeekDesk.Util;
|
||||||
using GeekDesk.ViewModel;
|
using GeekDesk.ViewModel;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Effects;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace GeekDesk.Control.UserControls.PannelCard
|
namespace GeekDesk.Control.UserControls.PannelCard
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,25 +15,45 @@
|
|||||||
MouseDown="DragMove"
|
MouseDown="DragMove"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<Window.Resources>
|
||||||
|
<Style x:Key="LeftTB" TargetType="TextBlock" BasedOn="{StaticResource TextBlockBaseStyle}">
|
||||||
|
<Setter Property="Width" Value="80"/>
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="FontSize" Value="11"/>
|
||||||
|
</Style>
|
||||||
|
</Window.Resources>
|
||||||
|
|
||||||
|
|
||||||
<Border MouseDown="DragMove">
|
<Border MouseDown="DragMove">
|
||||||
<Grid MouseDown="DragMove">
|
<Grid MouseDown="DragMove">
|
||||||
|
|
||||||
<hc:TabControl x:Name="MyTabControl" IsAnimationEnabled="True" SelectionChanged="TabControl_SelectionChanged" ShowContextMenu="True" IsTabFillEnabled="True" Margin="20,30,20,20" Height="350" VerticalAlignment="Top">
|
<hc:TabControl x:Name="MyTabControl" IsAnimationEnabled="True" SelectionChanged="TabControl_SelectionChanged" ShowContextMenu="True" IsTabFillEnabled="True" Margin="20,30,20,20" Height="350" VerticalAlignment="Top">
|
||||||
<hc:TabItem Tag="System" Header="系统" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource CalendarGeometry}" >
|
<hc:TabItem Tag="System" IsSelected="True" Header="系统图标" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource CalendarGeometry}" >
|
||||||
<hc:SimplePanel Background="AliceBlue">
|
<hc:SimplePanel Background="AliceBlue">
|
||||||
<uc:IconPannel IconfontList="{Binding iconListSystem}" IconInfo="{Binding iconInfoSystem}"/>
|
<!--<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,-10">
|
||||||
|
<TextBlock Text="SVG 图标地址:" Style="{StaticResource LeftTB}"/>
|
||||||
|
<TextBox x:Name="IconUrl1" Text="{Binding Name, Mode=OneWay}" Width="240" FontSize="11"/>
|
||||||
|
</hc:UniformSpacingPanel>
|
||||||
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,40,0,-40">
|
||||||
|
<TextBlock Text="JSON 配置地址:" Style="{StaticResource LeftTB}"/>
|
||||||
|
<TextBox x:Name="JsonUrl2" Text="{Binding Name, Mode=OneWay}" Width="240" FontSize="11"/>
|
||||||
|
</hc:UniformSpacingPanel>-->
|
||||||
|
<uc:IconPannel x:Name="SystemIcon"/>
|
||||||
</hc:SimplePanel>
|
</hc:SimplePanel>
|
||||||
</hc:TabItem>
|
</hc:TabItem>
|
||||||
<hc:TabItem Tag="Custom" IsSelected="True" Header="自定义" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource CalendarGeometry}">
|
<hc:TabItem Tag="Custom" Header="自定义图标" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource CalendarGeometry}">
|
||||||
<hc:SimplePanel Background="AliceBlue">
|
<hc:SimplePanel Background="AliceBlue">
|
||||||
<uc:IconPannel IconfontList="{Binding iconListCustom}" IconInfo="{Binding iconInfoCustom}"/>
|
<hc:LoadingCircle/>
|
||||||
|
<uc:IconPannel x:Name="CustomIcon"/>
|
||||||
</hc:SimplePanel>
|
</hc:SimplePanel>
|
||||||
</hc:TabItem>
|
</hc:TabItem>
|
||||||
</hc:TabControl>
|
</hc:TabControl>
|
||||||
|
|
||||||
|
|
||||||
<Button Content="取消" Click="Close_Click" Margin="406,397.5,148,22.5"/>
|
<Button Content="取消" Click="Close_Click" Margin="391,397.5,163,22.5"/>
|
||||||
<Button Content="确定" Click="Confirm_Click" Background="#5BC0DE" Foreground="White" Margin="500.5,397.5,53.5,22.5" RenderTransformOrigin="0.696,0.45"/>
|
<Button Content="自定义设置" Click="CustomButton_Click" IsEnabled="False" Name="CustomButton" Background="#5BC0DE" Foreground="White" RenderTransformOrigin="-0.868,0.583" Margin="447,397.5,71,22.5"/>
|
||||||
|
<Button Content="确定" Click="Confirm_Click" Background="#5BC0DE" Foreground="White" Margin="534,397.5,20,22.5" RenderTransformOrigin="0.696,0.45"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using GeekDesk.Util;
|
using GeekDesk.Control.Other;
|
||||||
|
using GeekDesk.Util;
|
||||||
using GeekDesk.ViewModel;
|
using GeekDesk.ViewModel;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -23,14 +25,15 @@ namespace GeekDesk.Control.Windows
|
|||||||
{
|
{
|
||||||
|
|
||||||
private static MenuInfo menuInfo;
|
private static MenuInfo menuInfo;
|
||||||
private DataContextInfo dataContextInfo = new DataContextInfo();
|
private static List<IconfontInfo> systemIcons;
|
||||||
|
private static List<IconfontInfo> customIcons;
|
||||||
private IconfontWindow(List<IconfontInfo> listInfo, MenuInfo menuInfo)
|
private IconfontWindow(List<IconfontInfo> icons, MenuInfo menuInfo)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
systemIcons = icons;
|
||||||
dataContextInfo.iconListSystem = listInfo;
|
this.DataContext = systemIcons;
|
||||||
this.DataContext = dataContextInfo;
|
this.Topmost = true;
|
||||||
IconfontWindow.menuInfo = menuInfo;
|
IconfontWindow.menuInfo = menuInfo;
|
||||||
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -55,25 +58,42 @@ namespace GeekDesk.Control.Windows
|
|||||||
|
|
||||||
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
//this.DataContext = listInfo;
|
TabItem ti = this.MyTabControl.SelectedItem as TabItem;
|
||||||
|
|
||||||
|
switch (ti.Tag.ToString())
|
||||||
|
{
|
||||||
|
case "Custom":
|
||||||
|
CustomButton.IsEnabled = true;
|
||||||
|
this.DataContext = customIcons;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (CustomButton != null)
|
||||||
|
{
|
||||||
|
CustomButton.IsEnabled = false;
|
||||||
|
}
|
||||||
|
this.DataContext = systemIcons;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Confirm_Click(object sender, RoutedEventArgs e)
|
private void Confirm_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
string tag = (MyTabControl.SelectedContent as TabItem).Tag.ToString();
|
TabItem ti = this.MyTabControl.SelectedItem as TabItem;
|
||||||
|
int index;
|
||||||
switch (tag)
|
switch (ti.Tag.ToString())
|
||||||
{
|
{
|
||||||
case "Custom":
|
case "Custom":
|
||||||
if (dataContextInfo.iconInfoCustom != null)
|
index = this.CustomIcon.IconListBox.SelectedIndex;
|
||||||
|
if (index != -1)
|
||||||
{
|
{
|
||||||
menuInfo.MenuGeometry = dataContextInfo.iconInfoCustom.Text;
|
menuInfo.MenuGeometry = customIcons[index].Text;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (dataContextInfo.iconInfoSystem != null)
|
index = this.SystemIcon.IconListBox.SelectedIndex;
|
||||||
|
if (index != -1)
|
||||||
{
|
{
|
||||||
menuInfo.MenuGeometry = dataContextInfo.iconInfoSystem.Text;
|
menuInfo.MenuGeometry = systemIcons[index].Text;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -91,13 +111,8 @@ namespace GeekDesk.Control.Windows
|
|||||||
window.Show();
|
window.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CustomButton_Click(object sender, RoutedEventArgs e)
|
||||||
private class DataContextInfo
|
|
||||||
{
|
{
|
||||||
public List<IconfontInfo> iconListSystem;
|
|
||||||
public List<IconfontInfo> iconListCustom;
|
|
||||||
public IconfontInfo iconInfoSystem;
|
|
||||||
public IconfontInfo iconInfoCustom;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,9 @@
|
|||||||
<Compile Include="Control\Other\BacklogNotificatin.xaml.cs">
|
<Compile Include="Control\Other\BacklogNotificatin.xaml.cs">
|
||||||
<DependentUpon>BacklogNotificatin.xaml</DependentUpon>
|
<DependentUpon>BacklogNotificatin.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Control\Other\CustomIconUrlDialog.xaml.cs">
|
||||||
|
<DependentUpon>CustomIconUrlDialog.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Control\UserControls\Backlog\BacklogControl.xaml.cs">
|
<Compile Include="Control\UserControls\Backlog\BacklogControl.xaml.cs">
|
||||||
<DependentUpon>BacklogControl.xaml</DependentUpon>
|
<DependentUpon>BacklogControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -167,6 +170,7 @@
|
|||||||
<Compile Include="Util\DragAdorner.cs" />
|
<Compile Include="Util\DragAdorner.cs" />
|
||||||
<Compile Include="Util\FileIcon.cs" />
|
<Compile Include="Util\FileIcon.cs" />
|
||||||
<Compile Include="Util\HotKey.cs" />
|
<Compile Include="Util\HotKey.cs" />
|
||||||
|
<Compile Include="Util\HttpUtil.cs" />
|
||||||
<Compile Include="Util\ImageUtil.cs" />
|
<Compile Include="Util\ImageUtil.cs" />
|
||||||
<Compile Include="Util\ListViewDragDropManager.cs" />
|
<Compile Include="Util\ListViewDragDropManager.cs" />
|
||||||
<Compile Include="Converts\MenuWidthConvert.cs" />
|
<Compile Include="Converts\MenuWidthConvert.cs" />
|
||||||
@@ -185,6 +189,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="Control\Other\CustomIconUrlDialog.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Include="Control\UserControls\Backlog\BacklogControl.xaml">
|
<Page Include="Control\UserControls\Backlog\BacklogControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -257,6 +265,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="Themes\Generic.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
|
|||||||
@@ -79,9 +79,6 @@ namespace GeekDesk
|
|||||||
{
|
{
|
||||||
HandyControl.Controls.Growl.WarningGlobal("启动快捷键已被其它程序占用(" + appData.AppConfig.HotkeyStr + ")!");
|
HandyControl.Controls.Growl.WarningGlobal("启动快捷键已被其它程序占用(" + appData.AppConfig.HotkeyStr + ")!");
|
||||||
}
|
}
|
||||||
//AeroGlassHelper.ExtendGlass(this);
|
|
||||||
//AeroGlassHelper.ExtendGlass(BBB, (int)this.Margin.Left, (int)this.Margin.Right, (int)this.Margin.Top, (int)this.Margin.Bottom);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
7
Themes/Generic.xaml
Normal file
7
Themes/Generic.xaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<ResourceDictionary
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="clr-namespace:GeekDesk.Control.Other">
|
||||||
|
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
29
Util/HttpUtil.cs
Normal file
29
Util/HttpUtil.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace GeekDesk.Util
|
||||||
|
{
|
||||||
|
public class HttpUtil
|
||||||
|
{
|
||||||
|
#region Get请求
|
||||||
|
public string Get(string url)
|
||||||
|
{
|
||||||
|
//创建Web访问对 象
|
||||||
|
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url);
|
||||||
|
//通过Web访问对象获取响应内容
|
||||||
|
HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
|
||||||
|
//通过响应内容流创建StreamReader对象,因为StreamReader更高级更快
|
||||||
|
StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
|
||||||
|
string returnStr = reader.ReadToEnd();//利用StreamReader就可以从响应内容从头读到尾
|
||||||
|
reader.Close();
|
||||||
|
myResponse.Close();
|
||||||
|
return returnStr;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,7 +4,6 @@ using GeekDesk.Util;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
@@ -38,11 +37,38 @@ namespace GeekDesk.ViewModel
|
|||||||
private int pannelCornerRadius = 4; //面板圆角 默认4
|
private int pannelCornerRadius = 4; //面板圆角 默认4
|
||||||
[field: NonSerialized]
|
[field: NonSerialized]
|
||||||
private ObservableCollection<IconInfo> selectedMenuIcons;
|
private ObservableCollection<IconInfo> selectedMenuIcons;
|
||||||
private string hotkeyStr = "Ctrl + Q";
|
private string hotkeyStr = "Ctrl + Q"; //默认启动面板快捷键
|
||||||
private HotkeyModifiers hotkeyModifiers = HotkeyModifiers.MOD_CONTROL;
|
private HotkeyModifiers hotkeyModifiers = HotkeyModifiers.MOD_CONTROL; //默认启动面板快捷键
|
||||||
private Key hotkey = Key.Q;
|
private Key hotkey = Key.Q; //默认启动面板快捷键
|
||||||
|
|
||||||
|
private string customIconUrl; //自定义图标url
|
||||||
|
private string customIconJsonUrl; //自定义图标json信息url
|
||||||
|
|
||||||
#region GetSet
|
#region GetSet
|
||||||
|
public string CustomIconUrl
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return customIconUrl;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
customIconUrl = value;
|
||||||
|
OnPropertyChanged("CustomIconUrl");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string CustomIconJsonUrl
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return customIconJsonUrl;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
customIconJsonUrl = value;
|
||||||
|
OnPropertyChanged("CustomIconJsonUrl");
|
||||||
|
}
|
||||||
|
}
|
||||||
public Key Hotkey
|
public Key Hotkey
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
Reference in New Issue
Block a user