Skip to content

Commit 74990ce

Browse files
committed
Some more changes
1 parent cbbdadc commit 74990ce

5 files changed

Lines changed: 34 additions & 19 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace NETworkManager.Controls
2+
{
3+
public class DragablzTabContent
4+
{
5+
public string Header { get; set; }
6+
public object Content { get; set; }
7+
8+
public DragablzTabContent(string header, object content)
9+
{
10+
Header = header;
11+
Content = content;
12+
}
13+
}
14+
}

‎Source/NETworkManager/NETworkManager.csproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
<Compile Include="3rdParty\Heijden.DNS\Response.cs" />
170170
<Compile Include="3rdParty\Heijden.DNS\RR.cs" />
171171
<Compile Include="3rdParty\Heijden.DNS\Structs.cs" />
172+
<Compile Include="Controls\DragablzTabContent.cs" />
172173
<Compile Include="Converters\TimestampToStringConverter.cs" />
173174
<Compile Include="Converters\NullableDateTimeToStringConverter.cs" />
174175
<Compile Include="Converters\ValidateSubnetCalculatorIPv4SplitterConverter.cs" />

‎Source/NETworkManager/Resources/Styles/DragablzStyles.xaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<DataTemplate>
5757
<StackPanel Orientation="Horizontal">
5858
<Grid>
59-
<TextBlock Text="{Binding}" VerticalAlignment="Center" Margin="10">
59+
<TextBlock Text="{Binding Header}" VerticalAlignment="Center" Margin="10">
6060
<TextBlock.Style>
6161
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource HeaderTextBlock}">
6262
<Setter Property="FontSize" Value="18" />
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
using System.Windows.Input;
2-
using MahApps.Metro.Controls.Dialogs;
3-
using System.Collections.ObjectModel;
4-
using NETworkManager.Models.Settings;
5-
using System.Collections.Generic;
6-
using NETworkManager.Models.Network;
7-
using NETworkManager.Helpers;
1+
using System.Collections.ObjectModel;
2+
using NETworkManager.Controls;
3+
using System;
4+
using NETworkManager.Views.Applications;
85

96
namespace NETworkManager.ViewModels.Applications
107
{
118
public class RemoteDesktopViewModel : ViewModelBase
129
{
10+
public ObservableCollection<DragablzTabContent> TabContents = new ObservableCollection<DragablzTabContent>();
11+
1312
public RemoteDesktopViewModel()
1413
{
14+
15+
}
1516

17+
public static Func<object> NewItemFactory
18+
{
19+
get { return () => new DragablzTabContent("test", new TracerouteView()); }
1620
}
1721
}
1822
}

‎Source/NETworkManager/Views/Applications/RemoteDesktopView.xaml‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,16 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6-
xmlns:ApplicationViews ="clr-namespace:NETworkManager.Views.Applications"
6+
xmlns:ViewModel ="clr-namespace:NETworkManager.ViewModels.Applications"
77
xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz"
88
mc:Ignorable="d">
99
<Grid>
10-
<dragablz:TabablzControl Style="{StaticResource DefaultTabablzControl}">
11-
<TabItem Header="One">
12-
<Button HorizontalAlignment="Center" VerticalAlignment="Center">Hello World</Button>
13-
</TabItem>
14-
<TabItem Header="Two">
15-
<Button HorizontalAlignment="Center" VerticalAlignment="Center">How are you doing</Button>
16-
</TabItem>
17-
<TabItem Header="Three">
18-
<Button HorizontalAlignment="Center" VerticalAlignment="Center">Goodbye</Button>
19-
</TabItem>
10+
<dragablz:TabablzControl ItemsSource="{Binding TabContents}">
11+
<dragablz:TabablzControl.Style>
12+
<Style TargetType="{x:Type dragablz:TabablzControl}" BasedOn="{StaticResource DefaultTabablzControl}">
13+
<Setter Property="NewItemFactory" Value="{x:Static ViewModel:RemoteDesktopViewModel.NewItemFactory}" />
14+
</Style>
15+
</dragablz:TabablzControl.Style>
2016
</dragablz:TabablzControl>
2117
</Grid>
2218
</UserControl>

0 commit comments

Comments
 (0)