This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//USAGE: | |
.SetResultTransformer(new DelegateTransformer<SomeNoSeQue>(m => new SomeNoSeQue((int)m[0],(string)m[1]){ Algo = m[3] }); | |
[Serializable] | |
public class DelegateTransformer<TEntity> : IResultTransformer | |
{ | |
private readonly Func<object[], TEntity> _transformFucntion; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<configSections> | |
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> | |
</configSections> | |
<log4net debug="false"> | |
<appender name="trace" | |
type="log4net.Appender.TraceAppender, log4net"> | |
<layout type="log4net.Layout.PatternLayout,log4net"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Input; | |
namespace Mantenimiento.ViewModels | |
{ | |
/// <summary> | |
/// This class implements a disposable WaitCursor to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void CreateNewView(Type viewModelType) | |
{ | |
using(new WaitCursor()){ | |
var viewModel = _viewModelFactory.CreateBrowseViewModel(viewModelType); | |
AddNewViewModel(viewModel); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Calculator | |
{ | |
public bool CanDivide(double left, double right) | |
{ | |
return right != 0; | |
} | |
[Preview("CanDivide")] | |
[AsyncAction(BlockInteraction = true)] | |
public double Divide(double left, double right) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Button Content="Divide (Attachment w/ Defaults)" | |
cm:Message.Attach="Divide" /> | |
<Button Content="Divide (Attachment w/ Default Trigger/Message and Explicit Parameters)" | |
cm:Message.Attach="Divide(left.Text, right.Text) : DivideResult.Text" /> | |
<Button Content="Divide (Attachment w/ Inferred Parameters)" | |
cm:Message.Attach="[Event Click] = [Action Divide]" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RelayCommand : ICommand | |
{ | |
#region Fields | |
private readonly Predicate<object> _canExecute; | |
private readonly Action<object> _execute; | |
#endregion // Fields | |
#region Constructors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RelayCommand : RelayCommand<object>{ | |
public RelayCommand(Action<object> execute) : base(execute) | |
{} | |
public RelayCommand(Action execute) : base(execute) | |
{} | |
public RelayCommand(Action execute, Func<bool> canExecute) : base(execute, canExecute) | |
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ICommand Prueba | |
{ | |
get | |
{ | |
if (_prueba == null) | |
_prueba = new AsyncRelayCommand<object, int>(o => Proceso()) | |
{ | |
Preview = o => Descripcion = "procesando...", | |
Completed = (o, result) => Descripcion = "terminado.." + result, | |
BlockInteraction = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private ICommand CreateCommand(DAOAction action) | |
{ | |
if(action != DAOAction.Insert) | |
{ | |
return new RelayCommand<IFormViewModel<T>>(vm => | |
{ | |
vm.Action = action; | |
OnRequestOpenNew(vm); | |
}, | |
vm => vm != null); |