mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Add button to reset chosen install location
This commit is contained in:
parent
d8842cc0cc
commit
41ca47ad0b
@ -23,9 +23,11 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Grid.Column="0" Margin="0,0,4,0" Text="{Binding InstallLocation, Mode=TwoWay}" />
|
||||
<ui:Button Grid.Column="1" Margin="4,0,0,0" Height="35" Icon="Folder24" Content="Browse" Command="{Binding BrowseInstallLocationCommand}" />
|
||||
<ui:Button Grid.Column="1" Margin="4,0,4,0" Height="35" Icon="Folder24" Content="Browse" Command="{Binding BrowseInstallLocationCommand}" />
|
||||
<ui:Button Grid.Column="2" Margin="4,0,0,0" Height="35" Icon="ArrowUndo24" Content="Reset" Command="{Binding ResetInstallLocationCommand}" />
|
||||
</Grid>
|
||||
</ui:CardExpander>
|
||||
|
||||
|
@ -11,7 +11,10 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
|
||||
private string _originalInstallLocation = App.BaseDirectory;
|
||||
|
||||
public ICommand BrowseInstallLocationCommand => new RelayCommand(BrowseInstallLocation);
|
||||
public ICommand ResetInstallLocationCommand => new RelayCommand(ResetInstallLocation);
|
||||
public ICommand OpenFolderCommand => new RelayCommand(OpenFolder);
|
||||
|
||||
private void BrowseInstallLocation()
|
||||
@ -22,7 +25,12 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
||||
return;
|
||||
|
||||
InstallLocation = dialog.SelectedPath;
|
||||
OnPropertyChanged(nameof(InstallLocation));
|
||||
}
|
||||
|
||||
private void ResetInstallLocation()
|
||||
{
|
||||
InstallLocation = _originalInstallLocation;
|
||||
OnPropertyChanged(nameof(InstallLocation));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user