Develop #10
28
DokterApp/ITab.cs
Normal file
28
DokterApp/ITab.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace DokterApp
|
||||
{
|
||||
public interface ITab
|
||||
{
|
||||
string Name { get; set; }
|
||||
ICommand CloseCommand { get; }
|
||||
event EventHandler CloseRequested;
|
||||
}
|
||||
|
||||
public abstract class Tab : ITab
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public ICommand CloseCommand { get; }
|
||||
public event EventHandler CloseRequested;
|
||||
|
||||
public Tab()
|
||||
{
|
||||
//CloseCommand =
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,5 +22,6 @@ namespace DokterApp
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
14
DokterApp/UserTab.cs
Normal file
14
DokterApp/UserTab.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace DokterApp
|
||||
{
|
||||
class UserTab : Tab
|
||||
{
|
||||
public UserTab()
|
||||
{
|
||||
Name = "Piet";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,14 +7,9 @@
|
||||
mc:Ignorable="d"
|
||||
Title="WindowTabs" Height="450" Width="800">
|
||||
<Grid>
|
||||
<TabControl>
|
||||
<TabItem Header="TabItem">
|
||||
<Grid Background="#FFE5E5E5"/>
|
||||
</TabItem>
|
||||
<TabItem Header="TabItem">
|
||||
<Grid Background="#FFE5E5E5"/>
|
||||
</TabItem>
|
||||
<TabControl x:Name="tabControl" Loaded="tabControl_Load">
|
||||
</TabControl>
|
||||
<Button Content="Button" HorizontalAlignment="Left" Margin="400,76,0,0" VerticalAlignment="Top" Click="Button_Click"/>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
@@ -17,9 +18,26 @@ namespace DokterApp
|
||||
/// </summary>
|
||||
public partial class WindowTabs : Window
|
||||
{
|
||||
public TabControl tbControl;
|
||||
public WindowTabs()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void tabControl_Load(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.tbControl = (sender as TabControl);
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
TabItem newTabItem = new TabItem
|
||||
{
|
||||
Header = "Test",
|
||||
|
||||
};
|
||||
newTabItem.Content = new UserControlForTab();
|
||||
this.tbControl.Items.Add(newTabItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "..\Client\Client.
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Message", "..\Message\Message.csproj", "{9ED6832D-B0FB-4460-9BCD-FAA58863B0CE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DokterApp", "..\DokterApp\DokterApp.csproj", "{B150F08B-13DA-4D17-BD96-7E89F52727C6}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DokterApp", "..\DokterApp\DokterApp.csproj", "{B150F08B-13DA-4D17-BD96-7E89F52727C6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
||||
Reference in New Issue
Block a user