📄 loginview.xaml
字号:
<!--
// **********************************************************************
//
// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
//
// This copy of Chat Demo is licensed to you under the terms
// described in the CHAT_DEMO_LICENSE file included in this
// distribution.
//
// **********************************************************************
-->
<!-- The LoginView WPF Page. -->
<Page x:Class="ChatDemoGUI.LoginView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="LoginView" Loaded="pageLoaded">
<StackPanel VerticalAlignment="Center" Orientation="Vertical"
IsEnabled="{Binding Source={StaticResource ChatModel}, Path=State,
Converter={StaticResource connectingBoolConverter}}"
MaxWidth="400" Margin="7,7,7,7">
<!-- Info text -->
<TextBlock HorizontalAlignment="Center" TextWrapping="WrapWithOverflow"
Style="{StaticResource TextTitle}" Text="Chat Demo"></TextBlock>
<TextBlock HorizontalAlignment="Center" TextWrapping="WrapWithOverflow"
Style="{StaticResource TextInfo}" Text="Welcome! You can login with any username / password."/>
<!-- Form fields , are connected to the LoginData of the ChatModel data provider instance
the passwords do not use bindings as they are not supported on PasswordBox for security.
The Mode="TwoWay" make that updates flow in both directions from components to properties
and from property to text box. -->
<StackPanel Orientation="Vertical">
<TextBlock Name="lblUsername">Username:</TextBlock>
<TextBox Name="txtUsername" Text="{Binding Source={StaticResource ChatModel},
Path=LoginData.Username, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<TextBlock TextWrapping="NoWrap">Password:</TextBlock>
<PasswordBox Name="txtPassword"></PasswordBox>
<!-- Check box for enable disable view advanced login options -->
<CheckBox
IsChecked="{Binding Source={StaticResource ChatModel},
Path=ShowAdvanced, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
<TextBlock Text="Show advanced options"></TextBlock>
</CheckBox>
<!-- Advanced options -->
<StackPanel Orientation="Vertical"
Visibility="{Binding Source={StaticResource ChatModel},
Path=ShowAdvanced, Mode=OneWay, UpdateSourceTrigger=PropertyChanged,
Converter={StaticResource boolVisibilityConverter}}">
<TextBlock TextWrapping="WrapWithOverflow">Host:</TextBlock>
<TextBox Name="txtHost" Text="{Binding Source={StaticResource ChatModel},
Path=LoginData.Host, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
</StackPanel>
</StackPanel>
<!-- The login button -->
<Button MaxWidth="60" Click="login" IsDefault="True"
Style="{StaticResource ToolBarButton}">Login</Button>
</StackPanel>
</Page>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -