forked from nuttylmao/NOOBS-CMDR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
170 lines (151 loc) · 11.1 KB
/
MainWindow.xaml
File metadata and controls
170 lines (151 loc) · 11.1 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<Window x:Class="NOOBS_CMDR.NOOBS_CMDR_Homepage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:NOOBS_CMDR" xmlns:controls="clr-namespace:NOOBS_CMDR.Controls" xmlns:actions="clr-namespace:NOOBS_CMDR.Controls.Commands"
xmlns:dd="urn:gong-wpf-dragdrop"
xmlns:commands="clr-namespace:NOOBS_CMDR.Commands" xmlns:converters="clr-namespace:NOOBS_CMDR.Converters"
mc:Ignorable="d"
Title="{Binding WindowTitle, RelativeSource={RelativeSource Mode=Self}}" Height="720" Width="1280" WindowStartupLocation="CenterScreen">
<Window.Resources>
<converters:InvertableBooleanToVisibilityConverter x:Key="BoolToVis" />
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Background="#353535" BorderThickness="0,0,0,1">
<Grid Margin="5">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Button x:Name="ConnectBtn" Click="ConnectBtn_Click" ToolTip="Click to disconnect" Visibility="{Binding obs.IsConnected, Mode=OneWay, Converter={StaticResource BoolToVis}, ConverterParameter=Normal, FallbackValue=Visible}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Image Source="pack://application:,,,/Resources/connected.png" RenderOptions.BitmapScalingMode="HighQuality"/>
<TextBlock Text="CONNECTED!" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" Margin="10,0"/>
</StackPanel>
</Button>
<Button Click="ConnectBtn_Click" ToolTip="Click to connect" Visibility="{Binding obs.IsConnected, Mode=OneWay, Converter={StaticResource BoolToVis}, ConverterParameter=Inverted, FallbackValue=Collapsed}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Image Source="pack://application:,,,/Resources/disconnected.png" RenderOptions.BitmapScalingMode="HighQuality"/>
<TextBlock Text="NOT CONNECTED!" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" Margin="10,0"/>
</StackPanel>
</Button>
<StackPanel Orientation="Horizontal" Visibility="{Binding obs.IsConnected, Mode=OneWay, Converter={StaticResource BoolToVis}, ConverterParameter=Inverted, FallbackValue=Collapsed}">
<TextBlock Text="Server" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" Margin="10,0"/>
<TextBox x:Name="ServerText" Width="120" ToolTip="Enter IP Address"/>
<TextBlock Text="Port" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" Margin="10,0"/>
<TextBox x:Name="PortText" Width="50" ToolTip="Enter port number"/>
<TextBlock Text="Password" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" Margin="10,0"/>
<PasswordBox x:Name="PasswordText" MinWidth="100" ToolTip="Enter password"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="ImportBtn" Width="70" Margin="10,0" Click="ImportBtn_Click" ToolTip="Import .bat or .vbs script">
<TextBlock Text="IMPORT" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" Margin="10,0"/>
</Button>
<Button x:Name="ExportBtn" Width="70" Margin="10,0" Click="ExportBtn_Click" ToolTip="Export to .bat or .vbs file">
<TextBlock Text="EXPORT" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" Margin="10,0"/>
</Button>
<Button x:Name="TestCommandBtn" Width="130" Margin="10,0" Click="TestCommandBtn_Click" Background="#30B774" Visibility="{Binding obs.IsConnected, Mode=OneWay, Converter={StaticResource BoolToVis}, ConverterParameter=Normal, FallbackValue=Visible}" ToolTip="Execute command!">
<TextBlock Text="TEST COMMAND!" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" Margin="10,0"/>
</Button>
</StackPanel>
</Grid>
</Border>
<Border Grid.Row="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Background="#222222" BorderThickness="0,0,1,0" Grid.RowSpan="2">
<DockPanel>
<controls:Searchbar x:Name="CommandTypeListSearch" Hint="Search..." DockPanel.Dock="Top" SearchTextChanged="Searchbar_SearchTextChanged" Margin="5"/>
<ListBox x:Name="CommandTypeList" ItemsSource="{Binding CommandTypes}" Background="Transparent" ScrollViewer.CanContentScroll="False" PreviewMouseDown="CommandTypeList_PreviewMouseDown" AlternationCount="2">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Focusable" Value="False"/>
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#1F1F1F"></Setter>
</Trigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Label Content="{Binding commandTypeDesc}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DockPanel>
</Border>
<Grid Grid.Column="1" Background="#2D2D2D">
<ListBox x:Name="CommandListBox" Background="Transparent" ScrollViewer.CanContentScroll="False" SelectionMode="Extended" dd:DragDrop.IsDragSource="True" dd:DragDrop.IsDropTarget="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" MouseDown="CommandList_MouseDown" PreviewKeyDown="CommandListBox_PreviewKeyDown" AlternationCount="2">
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem x:Name="Copy_MenuItem" Header="Copy" Click="Copy_MenuItem_Click"/>
<MenuItem x:Name="Paste_MenuItem" Header="Paste" Click="Paste_MenuItem_Click"/>
<MenuItem x:Name="Delete_MenuItem" Header="Delete" Click="Delete_MenuItem_Click"/>
<MenuItem x:Name="Duplicate_MenuItem" Header="Duplicate" Click="Duplicate_MenuItem_Click"/>
<Separator/>
<MenuItem x:Name="Test_MenuItem" Header="Execute Selected Commands!" Click="Test_MenuItem_Click"/>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.Resources>
<DataTemplate DataType="{x:Type commands:StreamCommand}">
<actions:StreamControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:RecordingCommand}">
<actions:RecordingControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:SceneCommand}">
<actions:SceneControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:ProfileCommand}">
<actions:ProfileControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:SourceCommand}">
<actions:SourceControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:FilterCommand}">
<actions:FilterControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:AudioCommand}">
<actions:AudioControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:MediaCommand}">
<actions:MediaControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:TransitionCommand}">
<actions:TransitionControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:StudioModeCommand}">
<actions:StudioModeControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:ScreenshotCommand}">
<actions:ScreenshotControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:ReplayBufferCommand}">
<actions:ReplayBufferControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:ProjectorCommand}">
<actions:ProjectorControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:DelayCommand}">
<actions:DelayControl Command="{Binding}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type commands:CustomCommand}">
<actions:CustomCommandControl Command="{Binding}"/>
</DataTemplate>
</ListBox.Resources>
</ListBox>
</Grid>
</Grid>
</Border>
</Grid>
</Window>