diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-11 13:11:27 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-11 13:11:27 +0200 |
| commit | adb47939226859aa952cb8c2123d331c16c88402 (patch) | |
| tree | 5db5b89b26ca5823b9416d2c426d4c216522b6b5 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage | |
| parent | 8d7ace94349c473c20fa5c06431897580e45aa82 (diff) | |
| download | Tango-adb47939226859aa952cb8c2123d331c16c88402.tar.gz Tango-adb47939226859aa952cb8c2123d331c16c88402.zip | |
Working on PPC...
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs | 22 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml | 14 |
2 files changed, 31 insertions, 5 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs index 3882fb486..688f82fe7 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs @@ -33,7 +33,23 @@ namespace Tango.PPC.Storage.ViewModels public StorageNavigationRequest Request { get { return _request; } - set { _request = value; RaisePropertyChangedAuto(); } + set + { + _request = value; + RaisePropertyChangedAuto(); + + if (_request != null) + { + FileName = _request.DefaultFileName; + } + } + } + + private String _fileName; + public String FileName + { + get { return _fileName; } + set { _fileName = value; RaisePropertyChangedAuto(); SaveCommand.RaiseCanExecuteChanged(); } } public RelayCommand<ExplorerFileItem> FileSelectedCommand { get; set; } @@ -43,7 +59,7 @@ namespace Tango.PPC.Storage.ViewModels public MainViewVM() { FileSelectedCommand = new RelayCommand<ExplorerFileItem>(OnFileSelected); - SaveCommand = new RelayCommand(OnSaveCommand); + SaveCommand = new RelayCommand(OnSaveCommand, (x) => !String.IsNullOrWhiteSpace(FileName)); Request = new StorageNavigationRequest(); } @@ -161,7 +177,7 @@ namespace Tango.PPC.Storage.ViewModels { _selectedItem = new ExplorerFileItem() { - Path = CurrentPath + "\\" + Request.DefaultFileName, + Path = CurrentPath + "\\" + FileName, }; NavigationManager.NavigateBack(); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml index 3b098f557..2ff1d5936 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml @@ -4,6 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:explorer="clr-namespace:Tango.Explorer;assembly=Tango.Explorer" xmlns:vm="clr-namespace:Tango.PPC.Storage.ViewModels" xmlns:models="clr-namespace:Tango.PPC.Storage.Models" @@ -11,6 +12,11 @@ xmlns:local="clr-namespace:Tango.PPC.Storage.Views" mc:Ignorable="d" d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + + <UserControl.InputBindings> + <KeyBinding Key="Return" Command="{Binding SaveCommand}"></KeyBinding> + </UserControl.InputBindings> + <Grid> <Grid Margin="10"> <DockPanel> @@ -20,8 +26,12 @@ <StackPanel> <TextBlock Text="{Binding Request.Title}" FontSize="{StaticResource TangoHeaderFontSize}"></TextBlock> <DockPanel Margin="0 10 0 0"> - <touch:TouchButton Command="{Binding SaveCommand}" Margin="20 0 0 0" Height="50" Width="200" Style="{StaticResource TangoHollowButton}" CornerRadius="0" DockPanel.Dock="Right">SAVE</touch:TouchButton> - <touch:TouchTextBox x:Name="txtFileName" FocusSelectionMode="SelectAll" VerticalAlignment="Bottom" Text="{Binding Request.DefaultFileName}" /> + <touch:TouchButton Command="{Binding SaveCommand}" Margin="20 0 0 0" Height="50" Width="200" Style="{StaticResource TangoHollowButton}" CornerRadius="0" DockPanel.Dock="Right"> + <touch:TouchButton.Content> + SAVE + </touch:TouchButton.Content> + </touch:TouchButton> + <touch:TouchTextBox x:Name="txtFileName" KeyboardAction="Go" FocusSelectionMode="SelectAll" VerticalAlignment="Bottom" Text="{Binding FileName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" /> </DockPanel> </StackPanel> </Border> |
