-
Notifications
You must be signed in to change notification settings - Fork 0
/
LoginWindow.xaml
65 lines (65 loc) · 2.86 KB
/
LoginWindow.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
<Window x:Class="Hbo.Sheepish.LoginWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
x:Name="ThisWindow"
Title="Login to YouTrack"
SizeToContent="Height" Width="320">
<Window.Icon>
<DrawingImage PresentationOptions:Freeze="True">
<DrawingImage.Drawing>
<GeometryDrawing Brush="Navy" Geometry="{StaticResource SheepSilhouetteGeometry}"/>
</DrawingImage.Drawing>
</DrawingImage>
</Window.Icon>
<DockPanel>
<StackPanel DockPanel.Dock="Bottom">
<Button Content="sign in" Margin="0,10,10,10" Padding="7,2" HorizontalAlignment="Right" Click="_OnSignInClick">
<Button.Style>
<Style TargetType="Button">
<Setter Property="IsEnabled" Value="False"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ThisWindow, Path=CanSubmit}" Value="True">
<Setter Property="IsEnabled" Value="True" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<ProgressBar Margin="8" Height="20" IsIndeterminate="True">
<ProgressBar.Style>
<Style TargetType="ProgressBar">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ThisWindow, Path=Processing}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</ProgressBar.Style>
</ProgressBar>
<TextBlock x:Name="ErrorOutput" TextWrapping="Wrap" Foreground="#FFC51313" Text="{Binding Path=ErrorText}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Margin" Value="10"/>
<Style.Triggers>
<Trigger Property="Text" Value="">
<Setter Property="Margin" Value="0"/>
<Setter Property="Visibility" Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
<DockPanel>
<Border DockPanel.Dock="Left" Margin="16,0,4,0" Width="48" Height="48" Background="{StaticResource YouTrackLogoBrush}"/>
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
<Label Content="username" Margin="10,0" />
<TextBox x:Name="UsernameInput" Margin="10,0" HorizontalAlignment="Stretch" KeyDown="_OnTextBoxKeyDown" />
<Label Content="password" Margin="10,0"/>
<PasswordBox x:Name="PasswordInput" Margin="10,0" HorizontalAlignment="Stretch" KeyDown="_OnTextBoxKeyDown" />
</StackPanel>
</DockPanel>
</DockPanel>
</Window>