-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
51 lines (48 loc) · 3.98 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<Window x:Class="Projekt2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:data="clr-namespace:System.Diagnostics;assembly=System"
Title="Task manager" Height="500" Width="700">
<Window.Resources>
<!--<ObjectDataProvider x:Key="odpProcesses" ObjectType="{x:Type data:Process}" MethodName="GetProcesses" DataChanged="ObjectDataProvider_DataChanged" IsAsynchronous="True"/>-->
<CollectionViewSource
Source="{Binding Source={x:Static Application.Current}, Path=Processes}"
x:Key="listingProcesses"/>
</Window.Resources>
<Grid Name="processGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="180"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Content="Processes list" Grid.Column="0" Grid.ColumnSpan="1" Grid.Row="0" Margin="10" FontSize="20" FontFamily="Arial" />
<ListView Name="processesList" ItemsSource="{Binding Source={StaticResource listingProcesses}}" Grid.Column="0" Grid.Row="1" Grid.RowSpan="4" HorizontalAlignment="Stretch" Height="Auto" Margin="10" VerticalAlignment="Stretch" Width="Auto" FontFamily="Lucida Console" SelectionChanged="processesList_SelectionChanged">
<ListView.View>
<GridView>
<GridViewColumn Header="Process name" DisplayMemberBinding="{Binding ProcessName}"/>
<GridViewColumn Header="ID" DisplayMemberBinding="{Binding Id}"/>
</GridView>
</ListView.View>
</ListView>
<Button Content="Refresh" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="10" Width="50" Click="Button_RefreshProcessesList"/>
<Button Content="Kill" Grid.Column="2" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="10" Width="50" Click="Button_KillProcess"/>
<Label Content="Details" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" HorizontalAlignment="Left" Margin="0" FontSize="15" />
<Label Content="Threads" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="3" HorizontalAlignment="Left" Margin="0" FontSize="10" />
<Label Content="Modules" Grid.Column="3" Grid.ColumnSpan="2" Grid.Row="3" HorizontalAlignment="Left" Margin="0" FontSize="10" />
<TextBox Name="detailsTextBox" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="4" HorizontalAlignment="Stretch" Height="Auto" Margin="10" TextWrapping="NoWrap" IsReadOnly="True" Text="" VerticalAlignment="Stretch" Width="Auto" FontFamily="Lucida Console" FontSize="12"/>
<ListBox Name="threadsListBox" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" Margin="10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" Width="Auto" FontFamily="Lucida Console" />
<ListBox Name="modulesListBox" Grid.Row="4" Grid.Column="3" Grid.ColumnSpan="2" Margin="10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" Width="Auto" FontFamily="Lucida Console" />
<Label Content="Process to keep (id)" Grid.Column="3" Grid.ColumnSpan="2" Grid.Row="0" HorizontalAlignment="Left" Margin="0" FontSize="10" />
<TextBox Name="keepAliveTB" Text="" IsReadOnly="True" Grid.Column="3" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="10"/>
<Button Name="keepAliveButton" Content="Keep alive" Grid.Column="4" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="10" Width="60" Click="Button_KeepAliveProcess"/>
</Grid>
</Window>