-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from Cassianvale/release/v1.2.1
Release/v1.2.1
- Loading branch information
Showing
12 changed files
with
210 additions
and
35 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Windows.Input; | ||
using System.Windows; | ||
using WpfApp.Commands; | ||
using WpfApp.Services; | ||
|
||
namespace WpfApp.ViewModels | ||
{ | ||
public class QRCodeViewModel : ViewModelBase | ||
{ | ||
private readonly LogManager _logger = LogManager.Instance; | ||
private ICommand? _goBackCommand; | ||
|
||
public ICommand GoBackCommand => _goBackCommand ??= new RelayCommand(GoBack); | ||
|
||
private void GoBack() | ||
{ | ||
try | ||
{ | ||
var mainWindow = Application.Current.MainWindow; | ||
if (mainWindow?.DataContext is MainViewModel mainViewModel) | ||
{ | ||
mainViewModel.NavigateCommand.Execute("About"); | ||
} | ||
_logger.LogDebug("QRCode", "返回About页面"); | ||
} | ||
catch (System.Exception ex) | ||
{ | ||
_logger.LogError("QRCode", "返回About页面失败", ex); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<Page x:Class="WpfApp.Views.QRCodeView" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
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" | ||
mc:Ignorable="d"> | ||
|
||
<Grid Margin="10"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="*"/> | ||
<RowDefinition Height="Auto"/> | ||
</Grid.RowDefinitions> | ||
|
||
<!-- 返回按钮 --> | ||
<Button Grid.Row="0" | ||
Content="返回" | ||
Command="{Binding GoBackCommand}" | ||
Style="{StaticResource PrimaryButtonStyle}" | ||
HorizontalAlignment="Left" | ||
Height="35" | ||
Width="80" | ||
Margin="0,0,0,10"/> | ||
|
||
<!-- 二维码容器 --> | ||
<Grid Grid.Row="1" VerticalAlignment="Center"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="*"/> | ||
</Grid.ColumnDefinitions> | ||
|
||
<!-- 左侧二维码 --> | ||
<StackPanel Grid.Column="0" | ||
Margin="0,10,20,0" | ||
HorizontalAlignment="Center"> | ||
<Image Source="pack://application:,,,/Resource/img/wechat_qr.png" | ||
Width="200" | ||
Height="200" | ||
RenderOptions.BitmapScalingMode="HighQuality"/> | ||
</StackPanel> | ||
|
||
<!-- 右侧二维码 --> | ||
<StackPanel Grid.Column="1" | ||
Margin="40,10,10,0" | ||
HorizontalAlignment="Center"> | ||
<Image Source="pack://application:,,,/Resource/img/wechat_qr_1.png" | ||
Width="200" | ||
Height="200" | ||
RenderOptions.BitmapScalingMode="HighQuality"/> | ||
</StackPanel> | ||
</Grid> | ||
|
||
<!-- 标题 --> | ||
<TextBlock Grid.Row="2" | ||
Text="感谢老板支持!" | ||
FontSize="24" | ||
FontWeight="Bold" | ||
HorizontalAlignment="Center" | ||
Margin="0,20,0,0"/> | ||
</Grid> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Windows.Controls; | ||
|
||
namespace WpfApp.Views | ||
{ | ||
public partial class QRCodeView : Page | ||
{ | ||
public QRCodeView() | ||
{ | ||
InitializeComponent(); | ||
DataContext = new ViewModels.QRCodeViewModel(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters