File tree Expand file tree Collapse file tree 5 files changed +15
-15
lines changed
Expand file tree Collapse file tree 5 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public override void OnBackPressed()
4444 MainViewModel . Instancia . EnClicNotaCommand . Execute ( null ) ;
4545 break ;
4646 case Páginas . editar :
47- MainViewModel . Instancia . AbirEditarCommand . Execute ( null ) ;
47+ MainViewModel . Instancia . ActualizarNotaCommand . Execute ( null ) ;
4848 break ;
4949 }
5050 }
Original file line number Diff line number Diff line change @@ -54,4 +54,11 @@ private void EnClicNota()
5454 {
5555 AbirNuevaNota ( ) ;
5656 }
57+
58+ [ RelayCommand ]
59+ private void ActualizarNota ( )
60+ {
61+ ( Vista as EditarNota ) ? . SobreescribirNota ( ) ;
62+ AbirDiario ( ) ;
63+ }
5764}
Original file line number Diff line number Diff line change 1515 BorderThickness =" 1"
1616 Margin =" -2" />
1717
18- <Button Click =" EnClicNotas "
18+ <Button Click =" EnClicCancelar "
1919 Margin =" 5, 0, 0, 0"
2020 Width =" 160"
2121 Height =" 45"
2222 CornerRadius =" 10"
2323 HorizontalAlignment =" Left" >
24- <TextBlock Text =" Notas "
24+ <TextBlock Text =" Cancelar "
2525 FontSize =" 18"
2626 VerticalAlignment =" Center"
2727 HorizontalAlignment =" Center" />
Original file line number Diff line number Diff line change @@ -37,26 +37,24 @@ public void SobreescribirNota()
3737 if ( string . IsNullOrEmpty ( Nota . Text ) )
3838 return ;
3939
40+ if ( NotaEditando . Texto == Nota . Text )
41+ return ;
42+
4043 // Guarda nota
4144 var nuevaNota = new Nota ( fecha , Nota . Text ) ;
4245 if ( ActualizarNota ( nuevaNota ) )
4346 Nota . Text = string . Empty ;
4447 }
4548
46- public void VolverAtras ( )
47- {
48- SobreescribirNota ( ) ;
49- }
50-
5149 public void EnClicEditar ( object sender , RoutedEventArgs args )
5250 {
5351 SobreescribirNota ( ) ;
5452 MainViewModel . Instancia ? . AbirDiarioCommand . Execute ( sender ) ;
5553 }
5654
57- public void EnClicNotas ( object sender , RoutedEventArgs args )
55+ public void EnClicCancelar ( object sender , RoutedEventArgs args )
5856 {
59- SobreescribirNota ( ) ;
57+ NotaEditando = new Nota ( string . Empty , string . Empty ) ;
6058 MainViewModel . Instancia ? . AbirDiarioCommand . Execute ( sender ) ;
6159 }
6260}
Original file line number Diff line number Diff line change @@ -42,11 +42,6 @@ public void CrearNota()
4242 Nota . Text = string . Empty ;
4343 }
4444
45- public void VolverAtras ( )
46- {
47- CrearNota ( ) ;
48- }
49-
5045 public void EnClicGuardar ( object sender , RoutedEventArgs args )
5146 {
5247 CrearNota ( ) ;
You can’t perform that action at this time.
0 commit comments