Skip to content

Commit

Permalink
QuickTool display key at last
Browse files Browse the repository at this point in the history
  • Loading branch information
1357310795 committed Sep 16, 2022
1 parent 25c4cbf commit e789442
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions TodoSynchronizer.QuickTool/Pages/Page3.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ private void Button_Click(object sender, RoutedEventArgs e)
var enc = AesHelper.Encrypt(Password, token);

DataService.SetData("tokenenc", enc);
DataService.SetData("password", Password);
NaviService.Navigate(new Page4());
}

Expand Down
16 changes: 13 additions & 3 deletions TodoSynchronizer.QuickTool/Pages/Page4.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,24 @@

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="完成!" Margin="0,10" FontSize="48" HorizontalAlignment="Center"/>
<TextBlock Grid.Row="1" Text="已复制加密的凭证到剪切板,请按照指南继续操作" FontSize="18" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBox AcceptsReturn="True" TextWrapping="Wrap" Grid.Row="2" Margin="10,0" FontSize="16" Text="{Binding Token}"/>
<Button Grid.Row="3" Content="关闭程序" Width="200" Height="40" Margin="0,10" FontSize="18" Click="Button_Click"/>
<TextBlock Grid.Row="1" Text="请按照部署指南继续操作" FontSize="18" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<Grid Grid.Row="2" Margin="10,0,10,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="密钥:" FontSize="16"/>
<TextBox FontSize="16" Grid.Column="1" Text="{Binding Password}"/>
</Grid>

<TextBox AcceptsReturn="True" TextWrapping="Wrap" Grid.Row="3" Margin="10,0" FontSize="16" Text="{Binding Token}" VerticalScrollBarVisibility="Auto"/>
<Button Grid.Row="4" Content="关闭程序" Width="200" Height="40" Margin="0,10" FontSize="18" Click="Button_Click"/>
</Grid>
</Page>
16 changes: 15 additions & 1 deletion TodoSynchronizer.QuickTool/Pages/Page4.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ public string Token
}
}

private string password;

public string Password
{
get { return password; }
set
{
password = value;
this.RaisePropertyChanged("Password");
}
}



private void Button_Click(object sender, RoutedEventArgs e)
{
Expand All @@ -65,7 +78,8 @@ protected void RaisePropertyChanged(string propertyName)
private void Page_Loaded(object sender, RoutedEventArgs e)
{
Token = DataService.GetData<string>("tokenenc");
Clipboard.SetText(Token);
Password = DataService.GetData<string>("password");
//Clipboard.SetText(Token);
}
}
}

0 comments on commit e789442

Please sign in to comment.