/
MainWindow.xaml
92 lines (86 loc) · 5.32 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
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
<Window x:Class="NSwagStudio.Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:viewModels="clr-namespace:NSwagStudio.ViewModels"
xmlns:views="clr-namespace:NSwagStudio.Views"
xmlns:controls="clr-namespace:NSwagStudio.Controls"
Title="NSwagStudio: The Swagger API toolchain for .NET and TypeScript"
MinHeight="650" MinWidth="1000" UseLayoutRounding="True"
WindowStartupLocation="CenterScreen"
Height="650" Width="1000">
<Window.Resources>
<viewModels:MainWindowModel x:Key="ViewModel" />
</Window.Resources>
<Grid DataContext="{StaticResource ViewModel}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Menu>
<MenuItem Header="_File">
<MenuItem Header="_New" Command="{Binding CreateDocumentCommand}" InputGestureText="Ctrl-N" />
<MenuItem Header="_Open" Command="{Binding OpenDocumentCommand}" InputGestureText="Ctrl-O" />
<MenuItem Header="_Close" InputGestureText="Ctrl-W"
Command="{Binding CloseDocumentCommand}"
CommandParameter="{Binding SelectedDocument}" />
<MenuItem Header="_Save" InputGestureText="Ctrl-S"
Command="{Binding SaveDocumentCommand}" CommandParameter="{Binding SelectedDocument}" />
<MenuItem Header="Save As" Command="{Binding SaveAsDocumentCommand}" CommandParameter="{Binding SelectedDocument}" />
</MenuItem>
</Menu>
<TabControl Grid.Row="1" TabStripPlacement="Left" Margin="8,8,0,0">
<!-- Documents -->
<TabItem Header="Documents" HeaderTemplate="{StaticResource RotatedTabItem}">
<TabControl ItemsSource="{Binding Documents}" controls:TabContent.IsCached="True"
SelectedItem="{Binding SelectedDocument, Mode=TwoWay}"
Margin="8">
<TabControl.ItemTemplate>
<DataTemplate>
<Grid ToolTip="{Binding Document.Path}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Document.Name}" VerticalAlignment="Center" Margin="0,2,0,0" />
<Button Grid.Column="1"
Content="X" Padding="6,2,6,2" Margin="8,3,0,2"
CommandParameter="{Binding}"
Command="{Binding CloseDocumentCommand, Source={StaticResource ViewModel}}" />
</Grid>
</DataTemplate>
</TabControl.ItemTemplate>
<controls:TabContent.Template>
<DataTemplate>
<views:DocumentView Document="{Binding}" Margin="8" />
</DataTemplate>
</controls:TabContent.Template>
</TabControl>
</TabItem>
<!-- About -->
<TabItem Header="About" HeaderTemplate="{StaticResource RotatedTabItem}">
<StackPanel Margin="8">
<TextBlock Margin="0,0,0,8" FontSize="16" FontWeight="Bold">
<Hyperlink NavigateUri="http://nswag.org" Click="OnOpenHyperlink">NSwag: The Swagger API toolchain for .NET and TypeScript</Hyperlink>
</TextBlock>
<TextBlock Margin="0,0,0,8" FontSize="14" TextWrapping="Wrap">
NSwag is a Swagger 2.0 API toolchain for .NET, TypeScript and other platforms, written in C#.
The Swagger specification uses JSON and JSON Schema to describe a RESTful web API.
The project provides tools to automatically generate client code from these Swagger
specifications and integrate this generation into existing processes.
</TextBlock>
<TextBlock Margin="0,0,0,8" FontSize="14">
NSwag and NSwagStudio have been developed by
<Hyperlink NavigateUri="http://www.rsuter.com" Click="OnOpenHyperlink">Rico Suter</Hyperlink> and other contributors.
</TextBlock>
<TextBlock Margin="0,0,0,8">
NSwag Version: <Run Text="{Binding NSwagVersion, Mode=OneWay}" /> <LineBreak />
NJsonSchema Version: <Run Text="{Binding NJsonSchemaVersion, Mode=OneWay}" />
</TextBlock>
<TextBlock Margin="0,0,0,8">
License: <Hyperlink NavigateUri="https://github.com/NSwag/NSwag/blob/master/LICENSE.md" Click="OnOpenHyperlink">MIT</Hyperlink>
</TextBlock>
</StackPanel>
</TabItem>
</TabControl>
</Grid>
</Window>