mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-22 01:16:17 +08:00
302 lines
15 KiB
XML
302 lines
15 KiB
XML
<metro:MetroWindow x:Class="SteamTools.AddAuthWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:livet="http://schemas.livet-mvvm.net/2011/wpf"
|
|
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:metro="http://schemes.grabacr.net/winfx/2014/controls"
|
|
xmlns:metro2="clr-namespace:MetroTrilithon.UI.Controls;assembly=MetroTrilithon.Desktop"
|
|
xmlns:viewModel="clr-namespace:SteamTools.ViewModels"
|
|
xmlns:prop="clr-namespace:SteamTools.Properties"
|
|
xmlns:services="clr-namespace:SteamTools.Services"
|
|
xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"
|
|
xmlns:controls="clr-namespace:SteamTools.Views.Controls"
|
|
mc:Ignorable="d"
|
|
Width="600"
|
|
Height="540"
|
|
IsRestoringWindowPlacement="True"
|
|
WindowStartupLocation="CenterScreen"
|
|
UseLayoutRounding="True"
|
|
TextOptions.TextFormattingMode="Display"
|
|
SnapsToDevicePixels="True"
|
|
Title="{Binding Title}"
|
|
Topmost="{Binding Topmost}"
|
|
Background="{DynamicResource ThemeBrushKey}"
|
|
Foreground="{DynamicResource ActiveForegroundBrushKey}"
|
|
FontFamily="{StaticResource DefaultFontFamilyKey}"
|
|
FontSize="14"
|
|
d:DataContext="{d:DesignInstance viewModel:AddAuthWindowViewModel}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="ContentRendered">
|
|
<livet:LivetCallMethodAction MethodTarget="{Binding}"
|
|
MethodName="Initialize" />
|
|
</i:EventTrigger>
|
|
|
|
<i:EventTrigger EventName="Closed">
|
|
<livet:DataContextDisposeAction />
|
|
</i:EventTrigger>
|
|
<livet:InteractionMessageTrigger Messenger="{Binding Messenger, Mode=OneWay}"
|
|
MessageKey="Window.Activate">
|
|
<livet:WindowInteractionMessageAction InvokeActionOnlyWhenWindowIsActive="False" />
|
|
</livet:InteractionMessageTrigger>
|
|
<livet:InteractionMessageTrigger Messenger="{Binding Messenger}"
|
|
MessageKey="Window.Transition">
|
|
<livet:TransitionInteractionMessageAction InvokeActionOnlyWhenWindowIsActive="False"
|
|
IsOwned="False" />
|
|
</livet:InteractionMessageTrigger>
|
|
<livet:InteractionMessageTrigger Messenger="{Binding Messenger}"
|
|
MessageKey="Window.Transition.Child">
|
|
<livet:TransitionInteractionMessageAction InvokeActionOnlyWhenWindowIsActive="False"
|
|
IsOwned="True" />
|
|
</livet:InteractionMessageTrigger>
|
|
</i:Interaction.Triggers>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<!--Title-->
|
|
<Border Grid.Row="0"
|
|
metro:MetroWindow.IsCaptionBar="True" >
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<metro:CaptionIcon Grid.Column="0" Padding="6,3">
|
|
<Image Source="pack://application:,,,/Resources/Asstes/app.ico" Width="32" Height="32"></Image>
|
|
</metro:CaptionIcon>
|
|
<TextBlock Grid.Column="1"
|
|
Grid.Row="0"
|
|
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=Title}"
|
|
TextTrimming="CharacterEllipsis"
|
|
Foreground="{DynamicResource ForegroundBrushKey}"
|
|
FontSize="16"
|
|
VerticalAlignment="Center" />
|
|
<metro:SystemButtons Grid.Column="2"
|
|
Grid.Row="0"
|
|
VerticalAlignment="Top" />
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!--Body-->
|
|
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
|
|
<ScrollViewer.Resources>
|
|
<Style TargetType="{x:Type TextBlock}">
|
|
<Setter Property="Margin"
|
|
Value="5,4" />
|
|
</Style>
|
|
<Style TargetType="{x:Type TextBox}">
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Foreground" Value="{DynamicResource ActiveForegroundBrushKey}" />
|
|
</Style>
|
|
<Style TargetType="{x:Type GridViewColumnHeader}">
|
|
<Setter Property="OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter Property="BorderThickness"
|
|
Value="0,0,0,.99" />
|
|
<Setter Property="BorderBrush"
|
|
Value="{DynamicResource BorderBrushKey}" />
|
|
<Setter Property="Background"
|
|
Value="{DynamicResource BackgroundBrushKey}" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
|
|
<Grid>
|
|
<Border BorderThickness="{TemplateBinding BorderThickness}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
Background="{TemplateBinding Background}">
|
|
<ContentPresenter Margin="{TemplateBinding Padding}" />
|
|
</Border>
|
|
<Thumb x:Name="PART_HeaderGripper"
|
|
HorizontalAlignment="Right"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
Margin="0,0,-6,0">
|
|
<Thumb.Template>
|
|
<ControlTemplate TargetType="{x:Type Thumb}">
|
|
<Border Background="Transparent"
|
|
Width="13">
|
|
<Rectangle Width=".99"
|
|
Stroke="{TemplateBinding BorderBrush}" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Thumb.Template>
|
|
</Thumb>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="TabHeaderTextStyleKey"
|
|
TargetType="{x:Type TextBlock}">
|
|
<Setter Property="Foreground"
|
|
Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabItem}}, Path=Foreground}" />
|
|
<Setter Property="Margin"
|
|
Value="14,0" />
|
|
<Setter Property="VerticalAlignment"
|
|
Value="Center" />
|
|
</Style>
|
|
</ScrollViewer.Resources>
|
|
<StackPanel Margin="8">
|
|
<StackPanel Margin="2">
|
|
<RadioButton x:Name="ImportWinAuth"
|
|
GroupName="Import" IsChecked="{Binding IsWinAuth,Mode=TwoWay}"
|
|
Content="从WinAuth导入" />
|
|
<StackPanel Margin="20,2,0,0"
|
|
Grid.IsSharedSizeScope="True">
|
|
<TextBlock Style="{DynamicResource DetailTextStyleKey}">
|
|
<Run Text="WinAuth是Windows的便携式开放源代码身份验证器,它提供基于计数器或基于时间的RFC 6238身份验证器和常见的实现。" />
|
|
<metro2:HyperlinkEx Uri="https://github.com/Jessecar96/SteamDesktopAuthenticator"><Run Text="Github"></Run></metro2:HyperlinkEx>
|
|
<LineBreak/>
|
|
<Run Text="导入方法:从WinAuth导出txt文件之后在此选择从WinAuth导出的txt文件进行导入。"></Run>
|
|
</TextBlock>
|
|
<Grid Visibility="{Binding ElementName=ImportWinAuth,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition SharedSizeGroup="Col0" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition SharedSizeGroup="Col1" />
|
|
<!--<ColumnDefinition SharedSizeGroup="Col2" />-->
|
|
</Grid.ColumnDefinitions>
|
|
<metro:PromptTextBox Grid.Row="0"
|
|
Grid.Column="1"
|
|
Text="{Binding WinAuthFileName, Mode=OneWay}"
|
|
IsEnabled="False"
|
|
Prompt="选择从WinAuth导出的txt文件" />
|
|
<metro2:CallMethodButton Grid.Column="2"
|
|
Content="选择文件"
|
|
MethodName="OpenWinAuthFile"
|
|
Margin="6,0" />
|
|
<!--<Button Grid.Column="3" Content="导入"></Button>-->
|
|
<!--<metro2:CallMethodButton Grid.Column="3"
|
|
Content="导入"
|
|
MethodName="ImportWinAuthFile"
|
|
Margin="0" />-->
|
|
</Grid>
|
|
</StackPanel>
|
|
<Border Height="8" />
|
|
<RadioButton x:Name="ImportSDA"
|
|
GroupName="Import" IsChecked="{Binding IsSDA,Mode=TwoWay}"
|
|
Content="从Steam Desktop Auth导入" />
|
|
<StackPanel Margin="20,0,0,0"
|
|
Grid.IsSharedSizeScope="True">
|
|
<StackPanel.Resources>
|
|
<Style TargetType="{x:Type metro:PromptTextBox}">
|
|
<Setter Property="Margin"
|
|
Value="0,3" />
|
|
</Style>
|
|
</StackPanel.Resources>
|
|
<TextBlock Style="{DynamicResource DetailTextStyleKey}"
|
|
Margin="0,2">
|
|
<Run Text="Steam的移动身份验证器应用程序的桌面实现。" />
|
|
<metro2:HyperlinkEx Uri="https://github.com/Jessecar96/SteamDesktopAuthenticator"><Run Text="Github"></Run></metro2:HyperlinkEx>
|
|
<LineBreak/>
|
|
<Run Text="导入方法:选择SDA目录下maFiles文件夹的maFile文件进行导入。" />
|
|
</TextBlock>
|
|
<Grid Visibility="{Binding ElementName=ImportSDA,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition SharedSizeGroup="Col0" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition SharedSizeGroup="Col1" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<metro:PromptTextBox Grid.Row="0"
|
|
Grid.Column="0" Grid.ColumnSpan="2"
|
|
Text="{Binding SDAFile, Mode=OneWay}"
|
|
Prompt="选择*.maFile文件" />
|
|
<metro2:CallMethodButton Grid.Column="2" Grid.Row="0"
|
|
Content="选择文件"
|
|
MethodName="OpenSDAFile"
|
|
Margin="6,0,0,0" />
|
|
<metro:PromptTextBox Grid.Row="1"
|
|
Grid.Column="0" Grid.ColumnSpan="3"
|
|
Text="{Binding SDAPassword, Mode=TwoWay}"
|
|
Prompt="如果设定了密码请输入密码" />
|
|
<!--<metro2:CallMethodButton Grid.Column="2" Grid.Row="1"
|
|
Content="导入"
|
|
MethodName="ImportWinAuthFile"
|
|
Margin="6,0" />-->
|
|
</Grid>
|
|
</StackPanel>
|
|
<Border Height="8" />
|
|
<RadioButton x:Name="ImportSteamApp"
|
|
GroupName="Import" IsChecked="{Binding IsSteamApp,Mode=TwoWay}"
|
|
Content="从Android App导入" />
|
|
<StackPanel Margin="20,2,0,0"
|
|
Grid.IsSharedSizeScope="True">
|
|
<TextBlock Style="{DynamicResource DetailTextStyleKey}">
|
|
<Run Text="您可以从已root的Android设备中导入您的SteamGuard身份验证器" />
|
|
<LineBreak />
|
|
<Run Text="路径: /data/data/com.valvesoftware.android.steam.community"></Run>
|
|
<LineBreak />
|
|
<Run Text="然后将以下两个文件的内容复制到下面的对应输入框中"/>
|
|
</TextBlock>
|
|
<StackPanel Visibility="{Binding ElementName=ImportSteamApp,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<metro:PromptTextBox Margin="0,5,0,0" Grid.Row="1"
|
|
Grid.Column="1"
|
|
Text="{Binding AuthName, Mode=TwoWay}"
|
|
Prompt="输入令牌的自定义名称" />
|
|
<TextBlock Grid.Row="0" Grid.Column="0">
|
|
<Run Text="从shared_prefs文件夹中,粘贴'steam_uuid.xml'的uuidKey" />
|
|
<LineBreak/>
|
|
<Run Text="格式:android:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" />
|
|
</TextBlock>
|
|
<metro:PromptTextBox Grid.Row="0"
|
|
Grid.Column="1"
|
|
Text="{Binding UUID, Mode=TwoWay}"
|
|
Prompt="" />
|
|
|
|
<TextBlock Grid.Row="1" Grid.Column="0">
|
|
<Run Text="从文件文件夹中,粘贴'SteamGuard-NNNNNNNN'的全部内容" />
|
|
</TextBlock>
|
|
<metro:PromptTextBox Grid.Row="1"
|
|
Grid.Column="1"
|
|
TextWrapping="Wrap"
|
|
AcceptsReturn="True"
|
|
VerticalScrollBarVisibility="Visible"
|
|
MaxLines="3"
|
|
Text="{Binding SteamGuard, Mode=TwoWay}"
|
|
Prompt="" />
|
|
<!--<metro2:CallMethodButton Width="80"
|
|
Content="导入"
|
|
HorizontalAlignment="Right"
|
|
MethodName="ImportSteamGuard"
|
|
Margin="6" />-->
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<Border Height="8" />
|
|
<Border Height="8" />
|
|
<StackPanel Orientation="Horizontal"
|
|
HorizontalAlignment="Right">
|
|
<metro2:CallMethodButton MethodTarget="{Binding}"
|
|
MethodName="Apply"
|
|
Content="确认导入"
|
|
MinWidth="110"
|
|
Padding="16,6" />
|
|
<Border Width="8" />
|
|
<!--<metro2:CallMethodButton MethodTarget="{Binding}"
|
|
MethodName="Cancel"
|
|
Content="取消"
|
|
MinWidth="110"
|
|
Padding="16,6" />-->
|
|
</StackPanel>
|
|
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
|
|
<!--Footer-->
|
|
<controls:StatusBar Grid.Row="2" DataContext="{Binding StatusBar}">
|
|
</controls:StatusBar>
|
|
|
|
</Grid>
|
|
</metro:MetroWindow>
|