forked from rstropek/Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
102 lines (99 loc) · 6.64 KB
/
Copy pathMainWindow.xaml
File metadata and controls
102 lines (99 loc) · 6.64 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<r:RibbonWindow x:Class="IronPython.UI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
xmlns:vm="clr-namespace:IronPython.UI.ViewModel"
Title="MainWindow" Height="350" Width="525">
<DockPanel LastChildFill="True">
<r:Ribbon DockPanel.Dock="Top"
Title="Test"
ContextMenu="{x:Null}">
<r:Ribbon.QuickAccessToolBar>
<r:RibbonQuickAccessToolBar Visibility="Collapsed" />
</r:Ribbon.QuickAccessToolBar>
<r:Ribbon.ApplicationMenu>
<r:RibbonApplicationMenu Visibility="Collapsed" />
</r:Ribbon.ApplicationMenu>
<r:RibbonTab Header="Main Menu">
<r:RibbonGroup Header="Content">
<r:RibbonButton SmallImageSource="{StaticResource ResourceKey=BusinessPeople16}"
LargeImageSource="{StaticResource ResourceKey=BusinessPeople32}"
Label="Speaker"
ToolTipTitle="Speaker"
ToolTipDescription="Click here to display speakers."
Command="{Binding Path=ShowSpeakersCommand}" />
<r:RibbonButton SmallImageSource="{StaticResource ResourceKey=Gantt16}"
LargeImageSource="{StaticResource ResourceKey=Gantt32}"
Label="Sessions"
ToolTipTitle="Sessions"
ToolTipDescription="Click here to display sessions."
Command="{Binding Path=ShowSessionsCommand}" />
</r:RibbonGroup>
<r:RibbonGroup Header="Scripting">
<r:RibbonButton SmallImageSource="{StaticResource ResourceKey=Eraser16}"
LargeImageSource="{StaticResource ResourceKey=Eraser32}"
Label="Erase Output"
ToolTipTitle="Erase Output"
ToolTipDescription="Click here to erase all script output."
Command="{Binding Path=EraseOutputCommand}" />
<r:RibbonButton SmallImageSource="{StaticResource ResourceKey=Document16}"
LargeImageSource="{StaticResource ResourceKey=Document32}"
Label="Run File"
ToolTipTitle="Run File"
ToolTipDescription="Click here to run a python script file."
Command="{Binding Path=RunScriptCommand}" />
<r:RibbonButton SmallImageSource="{StaticResource ResourceKey=Script16}"
LargeImageSource="{StaticResource ResourceKey=Script32}"
Label="Approve Session"
ToolTipTitle="Approve Session"
ToolTipDescription="Click here to approve the selected sessions."
Command="{Binding Path=ApproveSessionCommand}" />
<r:RibbonButton SmallImageSource="{StaticResource ResourceKey=Export16}"
LargeImageSource="{StaticResource ResourceKey=Export32}"
Label="Export Speakers"
ToolTipTitle="Export Speakers"
ToolTipDescription="Click here to export all speakers to Excel."
Command="{Binding Path=SpeakerExportCommand}" />
</r:RibbonGroup>
</r:RibbonTab>
</r:Ribbon>
<TabControl>
<TabItem Header="Database">
<Grid>
<DataGrid Visibility="{Binding Path=WindowContent, Converter={StaticResource ResourceKey=WindowContentVisibilityConverter}, ConverterParameter=Speakers}"
ItemsSource="{Binding Path=Speakers}" AutoGenerateColumns="False" IsReadOnly="True" SelectionMode="Single">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Path=FirstName}" Header="First Name" />
<DataGridTextColumn Binding="{Binding Path=LastName}" Header="Last Name" />
<DataGridTextColumn Binding="{Binding Path=Company}" Header="Company" />
<DataGridTextColumn Binding="{Binding Path=FullName}" Header="Full Name" />
<DataGridTextColumn Binding="{Binding Path=NumberOfApprovedSessions}" Header="Number of approved Sessions" />
<DataGridTemplateColumn Header="Number of approved Sessions">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Border Background="{Binding Path=NumberOfApprovedSessions, Converter={StaticResource ResourceKey=IronPythonExpressionConverter}, ConverterParameter='"Red" if Value == 0 else "Green"'}">
<TextBlock Text="{Binding Path=NumberOfApprovedSessions}" />
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<DataGrid Visibility="{Binding Path=WindowContent, Converter={StaticResource ResourceKey=WindowContentVisibilityConverter}, ConverterParameter=Sessions}"
ItemsSource="{Binding Path=Sessions}" AutoGenerateColumns="False" IsReadOnly="True" SelectionMode="Single"
SelectedItem="{Binding Path=SelectedSession, Mode=TwoWay}">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Path=Title}" Header="Title" />
<DataGridCheckBoxColumn Binding="{Binding Path=Approved}" Header="Approved" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</TabItem>
<TabItem Header="Script Output">
<TextBox IsReadOnly="True" FontFamily="Courier New" FontSize="12" AcceptsReturn="True" AcceptsTab="True"
Text="{Binding Path=ScriptOutput, Mode=OneWay}" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"/>
</TabItem>
</TabControl>
</DockPanel>
</r:RibbonWindow>