Skip to content

Commit 9ce8f10

Browse files
committed
save
1 parent 7918152 commit 9ce8f10

File tree

17 files changed

+199
-148
lines changed

17 files changed

+199
-148
lines changed

NetDebug/Common/LeftScroll.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
9+
namespace MeowType.NetDebug
10+
{
11+
public class LeftScroll: ContentControl
12+
{
13+
static LeftScroll()
14+
{
15+
DefaultStyleKeyProperty.OverrideMetadata(typeof(LeftScroll), new FrameworkPropertyMetadata(typeof(LeftScroll)));
16+
}
17+
}
18+
}

NetDebug/Common/LocalIP.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:MeowType.NetDebug"
77
mc:Ignorable="d"
8-
d:DesignHeight="50" d:DesignWidth="250">
8+
d:DesignHeight="50" d:DesignWidth="250" Height="50">
99
<Grid>
1010
<Grid.RowDefinitions>
1111
<RowDefinition Height="1*"></RowDefinition>

NetDebug/Common/LocalPort.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:MeowType.NetDebug"
77
mc:Ignorable="d"
8-
d:DesignHeight="50" d:DesignWidth="250">
8+
d:DesignHeight="50" d:DesignWidth="250" Height="50">
99
<Grid>
1010
<Grid.RowDefinitions>
1111
<RowDefinition Height="1*"></RowDefinition>

NetDebug/Common/TabView.xaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

NetDebug/Common/TargetPort.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:MeowType.NetDebug"
77
mc:Ignorable="d"
8-
d:DesignHeight="50" d:DesignWidth="250">
8+
d:DesignHeight="50" d:DesignWidth="250" Height="50">
99
<Grid>
1010
<Grid.RowDefinitions>
1111
<RowDefinition Height="1*"></RowDefinition>

NetDebug/EmptyTab.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<RowDefinition Height="*"></RowDefinition>
2727
<RowDefinition Height="*"></RowDefinition>
2828
</Grid.RowDefinitions>
29-
<Button Margin="10" FontSize="25">Tcp Server</Button>
29+
<Button Margin="10" FontSize="25" Click="TcpServer_Click">Tcp Server</Button>
3030
<Button Margin="10" FontSize="25" Grid.Column="1">Tcp Client</Button>
3131
<Button Margin="10" FontSize="25" Grid.Row="1" Click="Udp_Click">Udp</Button>
3232
<Button Margin="10" FontSize="25" Grid.Row="1" Grid.Column="1">Custom</Button>

NetDebug/EmptyTab.xaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,11 @@ private void Udp_Click(object sender, RoutedEventArgs e)
4141
TabView.Header = "Udp";
4242
TabView.Content = new Udp();
4343
}
44+
45+
private void TcpServer_Click(object sender, RoutedEventArgs e)
46+
{
47+
TabView.Header = "Tcp Server";
48+
TabView.Content = new TcpServer();
49+
}
4450
}
4551
}

NetDebug/NetDebug.csproj

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,11 @@
8484
<Generator>MSBuild:Compile</Generator>
8585
<SubType>Designer</SubType>
8686
</ApplicationDefinition>
87+
<Compile Include="Common\LeftScroll.cs" />
8788
<Compile Include="Common\MsgBox.Log.cs" />
8889
<Compile Include="Common\MsgBox.xaml.cs">
8990
<DependentUpon>MsgBox.xaml</DependentUpon>
9091
</Compile>
91-
<Compile Include="Common\TabView.xaml.cs">
92-
<DependentUpon>TabView.xaml</DependentUpon>
93-
</Compile>
9492
<Compile Include="EmptyTab.xaml.cs">
9593
<DependentUpon>EmptyTab.xaml</DependentUpon>
9694
</Compile>
@@ -114,22 +112,25 @@
114112
<Compile Include="TabView.xaml.cs">
115113
<DependentUpon>TabView.xaml</DependentUpon>
116114
</Compile>
115+
<Compile Include="Tcp\Server\TcpServer.xaml.cs">
116+
<DependentUpon>TcpServer.xaml</DependentUpon>
117+
</Compile>
117118
<Compile Include="Udp\Udp.xaml.cs">
118119
<DependentUpon>Udp.xaml</DependentUpon>
119120
</Compile>
120121
<Compile Include="Udp\UDPTargetIP.xaml.cs">
121122
<DependentUpon>UDPTargetIP.xaml</DependentUpon>
122123
</Compile>
123124
<Compile Include="Common\Utils.cs" />
124-
<Page Include="Common\LocalIP.xaml">
125+
<Page Include="Themes\Generic.xaml">
125126
<SubType>Designer</SubType>
126127
<Generator>MSBuild:Compile</Generator>
127128
</Page>
128-
<Page Include="Common\LocalPort.xaml">
129+
<Page Include="Common\LocalIP.xaml">
129130
<SubType>Designer</SubType>
130131
<Generator>MSBuild:Compile</Generator>
131132
</Page>
132-
<Page Include="Common\TabView.xaml">
133+
<Page Include="Common\LocalPort.xaml">
133134
<SubType>Designer</SubType>
134135
<Generator>MSBuild:Compile</Generator>
135136
</Page>
@@ -183,6 +184,10 @@
183184
<SubType>Designer</SubType>
184185
<Generator>MSBuild:Compile</Generator>
185186
</Page>
187+
<Page Include="Tcp\Server\TcpServer.xaml">
188+
<SubType>Designer</SubType>
189+
<Generator>MSBuild:Compile</Generator>
190+
</Page>
186191
<Page Include="Udp\Udp.xaml">
187192
<SubType>Designer</SubType>
188193
<Generator>MSBuild:Compile</Generator>

NetDebug/TabBar/Tab.xaml

Lines changed: 73 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -56,70 +56,79 @@
5656
</Setter.Value>
5757
</Setter>
5858
</Style>
59-
</UserControl.Resources>
60-
<Grid>
61-
<local:TabBg x:Name="tab_bg">
62-
<local:TabBg.Style>
63-
<Style TargetType="local:TabBg">
64-
<Setter Property="Opacity" Value="1"></Setter>
65-
<Style.Triggers>
66-
<DataTrigger Binding="{Binding IsSelected, ElementName=self}" Value="False">
67-
<Setter Property="Opacity" Value="0"></Setter>
68-
</DataTrigger>
69-
<DataTrigger Binding="{Binding IsHover, ElementName=self}" Value="True">
70-
<Setter Property="Opacity" Value="0.1"></Setter>
71-
</DataTrigger>
72-
</Style.Triggers>
73-
</Style>
74-
</local:TabBg.Style>
75-
</local:TabBg>
59+
<Style TargetType="local:Tab">
60+
<Setter Property="Template">
61+
<Setter.Value>
62+
<ControlTemplate TargetType="local:Tab">
63+
<Grid Margin="-1 0 0 0">
64+
<local:TabBg x:Name="tab_bg">
65+
<local:TabBg.Style>
66+
<Style TargetType="local:TabBg">
67+
<Setter Property="Opacity" Value="1"></Setter>
68+
<Style.Triggers>
69+
<DataTrigger Binding="{Binding IsSelected, ElementName=self}" Value="False">
70+
<Setter Property="Opacity" Value="0"></Setter>
71+
</DataTrigger>
72+
<DataTrigger Binding="{Binding IsHover, ElementName=self}" Value="True">
73+
<Setter Property="Opacity" Value="0.1"></Setter>
74+
</DataTrigger>
75+
</Style.Triggers>
76+
</Style>
77+
</local:TabBg.Style>
78+
</local:TabBg>
7679

77-
<Border Height="10" Width="1" Background="#77FFFFFF" HorizontalAlignment="Left"></Border>
78-
<Border Height="10" Width="1" Background="#77FFFFFF" HorizontalAlignment="Right"></Border>
80+
<Border Height="10" Width="1" Background="#77FFFFFF" HorizontalAlignment="Left" Panel.ZIndex="-1"></Border>
81+
<Border Height="10" Width="1" Background="#77FFFFFF" HorizontalAlignment="Right" Panel.ZIndex="-1"></Border>
7982

80-
<Grid WindowChrome.IsHitTestVisibleInChrome="True">
81-
<Grid.ColumnDefinitions>
82-
<ColumnDefinition Width="*"></ColumnDefinition>
83-
<ColumnDefinition Width="15"></ColumnDefinition>
84-
</Grid.ColumnDefinitions>
85-
<Label Name="TabContent" DataContext="{Binding ElementName=self}" Content="{Binding Title, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Padding="5,0" Margin="5,0,15,0" VerticalAlignment="Center">
86-
<Label.Effect>
87-
<DropShadowEffect ShadowDepth="0" BlurRadius="5" Opacity="0.5"/>
88-
</Label.Effect>
89-
<Label.Style>
90-
<Style TargetType="Label">
91-
<Setter Property="Foreground" Value="#FFFCFCFC"></Setter>
92-
<Style.Triggers>
93-
<DataTrigger Binding="{Binding IsSelected, ElementName=self}" Value="True">
94-
<Setter Property="Foreground" Value="#FF454545"></Setter>
95-
</DataTrigger>
96-
</Style.Triggers>
97-
</Style>
98-
</Label.Style>
99-
</Label>
100-
<Button Command="{x:Static dragablz:TabablzControl.CloseItemCommand}" Grid.Column="1" Height="15" Width="15" BorderThickness="0" Padding="0" Margin="-15,0,0,0" Click="Close_Click" Style="{DynamicResource CloseButtonStyle}">
101-
<Button.OpacityMask>
102-
<VisualBrush>
103-
<VisualBrush.Visual>
104-
<Ellipse Fill="White" Width="15" Height="15" />
105-
</VisualBrush.Visual>
106-
</VisualBrush>
107-
</Button.OpacityMask>
108-
<Button.Content>
109-
<Grid ClipToBounds="True">
110-
<Label FontSize="10" Padding="0" Margin="0" RenderTransformOrigin="0.5,0.5" Foreground="#FF787878">
111-
<Label.RenderTransform>
112-
<TransformGroup>
113-
<ScaleTransform ScaleX="1.5" ScaleY="1.5"/>
114-
<SkewTransform/>
115-
<RotateTransform/>
116-
<TranslateTransform/>
117-
</TransformGroup>
118-
</Label.RenderTransform> ×
119-
</Label>
120-
</Grid>
121-
</Button.Content>
122-
</Button>
123-
</Grid>
124-
</Grid>
83+
<Grid WindowChrome.IsHitTestVisibleInChrome="True">
84+
<Grid.ColumnDefinitions>
85+
<ColumnDefinition Width="*"></ColumnDefinition>
86+
<ColumnDefinition Width="15"></ColumnDefinition>
87+
</Grid.ColumnDefinitions>
88+
<Label Name="TabContent" Padding="5,0" Margin="5,0,15,0" VerticalAlignment="Center">
89+
<Label.Effect>
90+
<DropShadowEffect ShadowDepth="0" BlurRadius="5" Opacity="0.5"/>
91+
</Label.Effect>
92+
<Label.Style>
93+
<Style TargetType="Label">
94+
<Setter Property="Foreground" Value="#FFFCFCFC"></Setter>
95+
<Style.Triggers>
96+
<DataTrigger Binding="{Binding IsSelected, ElementName=self}" Value="True">
97+
<Setter Property="Foreground" Value="#FF454545"></Setter>
98+
</DataTrigger>
99+
</Style.Triggers>
100+
</Style>
101+
</Label.Style>
102+
<ContentPresenter></ContentPresenter>
103+
</Label>
104+
<Button Command="{x:Static dragablz:TabablzControl.CloseItemCommand}" Grid.Column="1" Height="15" Width="15" BorderThickness="0" Padding="0" Margin="-15,0,0,0" Click="Close_Click" Style="{DynamicResource CloseButtonStyle}">
105+
<Button.OpacityMask>
106+
<VisualBrush>
107+
<VisualBrush.Visual>
108+
<Ellipse Fill="White" Width="15" Height="15" />
109+
</VisualBrush.Visual>
110+
</VisualBrush>
111+
</Button.OpacityMask>
112+
<Button.Content>
113+
<Grid ClipToBounds="True">
114+
<Label FontSize="10" Padding="0" Margin="0" RenderTransformOrigin="0.5,0.5" Foreground="#FF787878">
115+
<Label.RenderTransform>
116+
<TransformGroup>
117+
<ScaleTransform ScaleX="1.5" ScaleY="1.5"/>
118+
<SkewTransform/>
119+
<RotateTransform/>
120+
<TranslateTransform/>
121+
</TransformGroup>
122+
</Label.RenderTransform> ×
123+
</Label>
124+
</Grid>
125+
</Button.Content>
126+
</Button>
127+
</Grid>
128+
</Grid>
129+
</ControlTemplate>
130+
</Setter.Value>
131+
</Setter>
132+
</Style>
133+
</UserControl.Resources>
125134
</UserControl>

NetDebug/TabBar/Tab.xaml.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,15 @@ public bool IsHover
4949
public static readonly DependencyProperty IsHoverProperty =
5050
DependencyProperty.Register("IsHover", typeof(bool), typeof(Tab), new PropertyMetadata(false));
5151

52-
public string Title
52+
public new object Content
5353
{
54-
get { return (string)GetValue(TitleProperty); }
55-
set {
56-
SetValue(TitleProperty, value);
57-
TabContent.Content = value;
58-
}
54+
get { return (object)GetValue(ContentProperty); }
55+
set { SetValue(ContentProperty, value); }
5956
}
6057

61-
// Using a DependencyProperty as the backing store for Title. This enables animation, styling, binding, etc...
62-
public static readonly DependencyProperty TitleProperty =
63-
DependencyProperty.Register("Title", typeof(string), typeof(Tab), new PropertyMetadata("NoTitle"));
58+
// Using a DependencyProperty as the backing store for Content. This enables animation, styling, binding, etc...
59+
public new static readonly DependencyProperty ContentProperty =
60+
DependencyProperty.Register("Content", typeof(object), typeof(Tab), new PropertyMetadata("No Title"));
6461

6562
private void Close_Click(object sender, RoutedEventArgs e)
6663
{

0 commit comments

Comments
 (0)