/* ----------------------------------------------------------------- */ /// /// PositionElement /// /// <summary> /// Initializes a new instance of the InsertPosition class /// with the specified arguments. /// </summary> /// /* ----------------------------------------------------------------- */ public InsertPosition(InsertBindable data) : base(() => Properties.Resources.MenuInsertPosition) { Command = new RelayCommand <int>(e => data.Index.Value = e); Selected = new BindableElement <bool>( () => data.SelectedIndex >= 0, () => Properties.Resources.MenuPositionSelected ); UserSpecified = new BindableElement <int>( () => data.UserSpecifiedIndex.Value + 1, e => { data.UserSpecifiedIndex.Value = e - 1; return(true); }, () => Properties.Resources.MenuPositionSpecified ); UserSpecifiedSuffix = new BindableElement(() => string.Format( $"/ {Properties.Resources.MessagePage}", data.Count )); }
/* ----------------------------------------------------------------- */ /// /// InsertFacade /// /// <summary> /// Initializes a new instance of the InsertFacade with the /// specified argumetns. /// </summary> /// /// <param name="i">Selected index.</param> /// <param name="n">Number of pages.</param> /// <param name="io">I/O handler</param> /// <param name="context">Synchronization context.</param> /// /* ----------------------------------------------------------------- */ public InsertFacade(int i, int n, IO io, SynchronizationContext context) { IO = io; Bindable = new InsertBindable(i, n, context); }