mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-29 00:24:42 +01:00
Add cancel button in dialogs
This commit is contained in:
@@ -68,11 +68,13 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- content -->
|
||||
</Grid.RowDefinitions>
|
||||
<InfoBar
|
||||
x:Uid="StateNotUpToDateInfoBar"
|
||||
Grid.Row="1"
|
||||
IsOpen="True"
|
||||
Severity="Warning" />
|
||||
<Grid Grid.Row="1">
|
||||
<InfoBar
|
||||
x:Uid="StateNotUpToDateInfoBar"
|
||||
IsOpen="{x:Bind ViewModel.IsStateModified, Mode=TwoWay}"
|
||||
Severity="Warning"
|
||||
Visibility="{x:Bind ViewModel.IsStateModified, Mode=TwoWay, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||
</Grid>
|
||||
|
||||
<!-- buttons -->
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@@ -268,6 +270,7 @@
|
||||
x:Name="EditVariableDialog"
|
||||
x:Uid="EditVariableDialog"
|
||||
IsPrimaryButtonEnabled="True"
|
||||
IsSecondaryButtonEnabled="True"
|
||||
PrimaryButtonStyle="{StaticResource AccentButtonStyle}">
|
||||
<ContentDialog.DataContext>
|
||||
<models:Variable />
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace EnvironmentVariables.Views
|
||||
|
||||
EditVariableDialog.Title = resourceLoader.GetString("EditVariableDialog_Title");
|
||||
EditVariableDialog.PrimaryButtonText = resourceLoader.GetString("SaveBtn");
|
||||
EditVariableDialog.SecondaryButtonText = resourceLoader.GetString("CancelBtn");
|
||||
EditVariableDialog.PrimaryButtonCommand = EditCommand;
|
||||
EditVariableDialog.PrimaryButtonCommandParameter = card;
|
||||
|
||||
@@ -72,6 +73,7 @@ namespace EnvironmentVariables.Views
|
||||
var resourceLoader = Helpers.ResourceLoaderInstance.ResourceLoader;
|
||||
AddProfileDialog.Title = resourceLoader.GetString("AddNewProfileDialog_Title");
|
||||
AddProfileDialog.PrimaryButtonText = resourceLoader.GetString("AddBtn");
|
||||
AddProfileDialog.SecondaryButtonText = resourceLoader.GetString("CancelBtn");
|
||||
AddProfileDialog.PrimaryButtonCommand = AddProfileCommand;
|
||||
AddProfileDialog.DataContext = new ProfileVariablesSet(Guid.NewGuid(), string.Empty);
|
||||
await AddProfileDialog.ShowAsync();
|
||||
|
||||
@@ -224,4 +224,7 @@
|
||||
<data name="StateNotUpToDateInfoBar.Message" xml:space="preserve">
|
||||
<value>Variables have been modified. Reload to get the latest changes.</value>
|
||||
</data>
|
||||
<data name="CancelBtn" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user