Arreglos ventana marchando una de
parent
e6be0f2aa4
commit
bac4c6abf0
|
|
@ -90,6 +90,7 @@ namespace OliviaAddInPro.Helper
|
|||
public MyCancelableProgressorSource(IprocessManager prodlg)
|
||||
{
|
||||
_ProgrSrc = prodlg;
|
||||
_ProgrSrc.Inicia();
|
||||
}
|
||||
public void Init(string stat)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,5 +14,6 @@ namespace OliviaAddInPro.Model.contract
|
|||
double GetProgress();
|
||||
bool Getcancelled();
|
||||
void Setcancelled();
|
||||
void Inicia();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace OliviaAddInPro.Services
|
|||
{
|
||||
public void finEjecuta(Respuesta<TiposEjecucion> res)
|
||||
{
|
||||
OliviaGlob.progrDialog.Hide();
|
||||
|
||||
String msg=string.Empty;
|
||||
//gestiona los flags, el estado de finok o finnok va en res.Vale
|
||||
if (res.HasError)
|
||||
|
|
@ -41,8 +41,9 @@ namespace OliviaAddInPro.Services
|
|||
|
||||
public void finEjecuta2()
|
||||
{
|
||||
//muestra la ventana
|
||||
OliviaGlob.ShowHidePane(true);
|
||||
OliviaGlob.progrDialog.Hide();
|
||||
//muestra la ventana
|
||||
OliviaGlob.ShowHidePane(true);
|
||||
}
|
||||
|
||||
//se le llama cuando ha terminado el proceso de ejecución en Olivia Tasks
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ namespace OliviaAddInPro.Services
|
|||
bool fin = false;
|
||||
int lastprog = 0;
|
||||
var res = new Respuesta<TiposEjecucion>() { Value = TiposEjecucion.FinEjecNOk };
|
||||
|
||||
cps.SetProceso("Procesando Datos");
|
||||
try
|
||||
{
|
||||
do
|
||||
|
|
|
|||
|
|
@ -6,12 +6,14 @@
|
|||
xmlns:ui="clr-namespace:OliviaAddInPro"
|
||||
xmlns:local="clr-namespace:OliviaAddInPro"
|
||||
mc:Ignorable="d"
|
||||
Title="MarchandoUnaDe" Height="165" Width="462"
|
||||
d:DataContext="{Binding Path=ui.MarchandoUnaDeViewModel}">
|
||||
Title="MarchandoUnaDe" Height="168" Width="481"
|
||||
d:DataContext="{Binding Path=ui.MarchandoUnaDeViewModel}"
|
||||
ResizeMode="NoResize">
|
||||
|
||||
<Grid>
|
||||
<Label Content="{Binding TextProceso}" HorizontalAlignment="Left" Margin="76,24,0,0" VerticalAlignment="Top" Width="303" Height="26"/>
|
||||
<ProgressBar Minimum="0" Maximum="100" HorizontalAlignment="Left" Value="{Binding Progreso, UpdateSourceTrigger=PropertyChanged}" Height="20" Margin="76,66,0,0" VerticalAlignment="Top" Width="303"/>
|
||||
<Label Content="{Binding TextEstado}" HorizontalAlignment="Left" Margin="95,91,0,0" VerticalAlignment="Top" Width="265" Height="28"/>
|
||||
<Label Content="{Binding TextProceso}" HorizontalAlignment="Left" Margin="76,10,0,0" VerticalAlignment="Top" Width="303" Height="26"/>
|
||||
<ProgressBar Minimum="0" Maximum="100" HorizontalAlignment="Left" Value="{Binding Progreso, UpdateSourceTrigger=PropertyChanged}" Height="20" Margin="76,40,0,0" VerticalAlignment="Top" Width="303"/>
|
||||
<Label Content="{Binding TextEstado}" HorizontalAlignment="Left" Margin="76,70,0,0" VerticalAlignment="Top" Width="303" Height="28"/>
|
||||
<Button Content="Cancelar" HorizontalAlignment="Left" Margin="304,103,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -23,6 +24,7 @@ namespace OliviaAddInPro
|
|||
{
|
||||
InitializeComponent();
|
||||
DataContext = new MarchandoUnaDeViewModel();
|
||||
//WindowStyle = WindowStyle.None;
|
||||
}
|
||||
|
||||
public MarchandoUnaDeViewModel GetViewModel()
|
||||
|
|
@ -31,5 +33,17 @@ namespace OliviaAddInPro
|
|||
return m;
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override void OnClosing(CancelEventArgs e)
|
||||
{
|
||||
GetViewModel().Cancelado = true;
|
||||
base.OnClosing(e);
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
GetViewModel().CancelaOperacion();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
using OliviaAddInPro.Model.contract;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -10,6 +11,11 @@ namespace OliviaAddInPro
|
|||
{
|
||||
public class MarchandoUnaDeViewModel : PropertyChangedBase, IprocessManager
|
||||
{
|
||||
public MarchandoUnaDeViewModel()
|
||||
{
|
||||
Cancelado = false;
|
||||
}
|
||||
public bool Cancelado { get; set; }
|
||||
|
||||
private string textProceso;
|
||||
public string TextProceso
|
||||
|
|
@ -36,7 +42,10 @@ namespace OliviaAddInPro
|
|||
{
|
||||
TextProceso = proceso;
|
||||
}
|
||||
|
||||
void IprocessManager.Inicia()
|
||||
{
|
||||
Cancelado = false;
|
||||
}
|
||||
void IprocessManager.SetEstado(string estado)
|
||||
{
|
||||
TextEstado = estado;
|
||||
|
|
@ -54,12 +63,18 @@ namespace OliviaAddInPro
|
|||
|
||||
bool IprocessManager.Getcancelled()
|
||||
{
|
||||
return false;
|
||||
return Cancelado;
|
||||
}
|
||||
|
||||
void IprocessManager.Setcancelled()
|
||||
{
|
||||
|
||||
CancelaOperacion();
|
||||
}
|
||||
public void CancelaOperacion()
|
||||
{
|
||||
TextProceso = "Cancelando proceso";
|
||||
Cancelado = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue