mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
fix #956
This commit is contained in:
@@ -17,6 +17,6 @@
|
||||
Margin="0,0,0,8"
|
||||
VerticalAlignment="Top"
|
||||
PlaceholderText="{shcm:ResourceString Name=ViewDialogAchievementArchiveCreateInputPlaceholder}"
|
||||
Text="{x:Bind Text, Mode=TwoWay}"/>
|
||||
Text="{x:Bind Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<TextBox
|
||||
VerticalAlignment="Top"
|
||||
PlaceholderText="{shcm:ResourceString Name=ViewDialogCultivateProjectInputPlaceholder}"
|
||||
Text="{x:Bind Text, Mode=TwoWay}"/>
|
||||
Text="{x:Bind Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
<CheckBox
|
||||
Margin="0,8,0,0"
|
||||
Content="{shcm:ResourceString Name=ViewDialogCultivateProjectAttachUid}"
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
|
||||
<Grid>
|
||||
<TextBox
|
||||
x:Name="InputText"
|
||||
Margin="0,0,0,0"
|
||||
VerticalAlignment="Top"
|
||||
PlaceholderText="{shcm:ResourceString Name=ViewDialogLaunchGameAccountInputPlaceholder}"/>
|
||||
PlaceholderText="{shcm:ResourceString Name=ViewDialogLaunchGameAccountInputPlaceholder}"
|
||||
Text="{x:Bind Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace Snap.Hutao.View.Dialog;
|
||||
/// 游戏账号命名对话框
|
||||
/// </summary>
|
||||
[HighQuality]
|
||||
[DependencyProperty("Text", typeof(string))]
|
||||
internal sealed partial class LaunchGameAccountNameDialog : ContentDialog
|
||||
{
|
||||
private readonly ITaskContext taskContext;
|
||||
@@ -33,7 +34,6 @@ internal sealed partial class LaunchGameAccountNameDialog : ContentDialog
|
||||
{
|
||||
await taskContext.SwitchToMainThreadAsync();
|
||||
ContentDialogResult result = await ShowAsync();
|
||||
string text = InputText.Text;
|
||||
return new(result == ContentDialogResult.Primary && (!string.IsNullOrEmpty(text)), text);
|
||||
return new(result == ContentDialogResult.Primary && (!string.IsNullOrEmpty(Text)), Text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,16 @@
|
||||
Title="{shcm:ResourceString Name=ViewDialogUserTitle}"
|
||||
CloseButtonText="{shcm:ResourceString Name=ContentDialogCancelCloseButtonText}"
|
||||
DefaultButton="Primary"
|
||||
IsPrimaryButtonEnabled="False"
|
||||
PrimaryButtonText="{shcm:ResourceString Name=ContentDialogConfirmPrimaryButtonText}"
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<StackPanel>
|
||||
<TextBox
|
||||
x:Name="InputText"
|
||||
Margin="0,0,0,8"
|
||||
VerticalAlignment="Top"
|
||||
PlaceholderText="{shcm:ResourceString Name=ViewDialogUserInputPlaceholder}"
|
||||
TextChanged="InputTextChanged"/>
|
||||
Text="{x:Bind Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
<StackPanel Margin="0,0,0,0">
|
||||
<StackPanel.Resources>
|
||||
<x:Double x:Key="SettingsCardWrapThreshold">0</x:Double>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Snap.Hutao.View.Dialog;
|
||||
@@ -9,6 +10,7 @@ namespace Snap.Hutao.View.Dialog;
|
||||
/// 添加用户对话框
|
||||
/// </summary>
|
||||
[HighQuality]
|
||||
[DependencyProperty("Text", typeof(string))]
|
||||
internal sealed partial class UserDialog : ContentDialog
|
||||
{
|
||||
private readonly ITaskContext taskContext;
|
||||
@@ -33,13 +35,6 @@ internal sealed partial class UserDialog : ContentDialog
|
||||
{
|
||||
await taskContext.SwitchToMainThreadAsync();
|
||||
ContentDialogResult result = await ShowAsync();
|
||||
string cookie = InputText.Text;
|
||||
|
||||
return new(result == ContentDialogResult.Primary, cookie);
|
||||
}
|
||||
|
||||
private void InputTextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
IsPrimaryButtonEnabled = !string.IsNullOrEmpty(InputText.Text);
|
||||
return new(result == ContentDialogResult.Primary && !string.IsNullOrEmpty(Text), Text);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user