本文整理汇总了C#中IWindowManager.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# IWindowManager.ShowDialog方法的具体用法?C# IWindowManager.ShowDialog怎么用?C# IWindowManager.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWindowManager
的用法示例。
在下文中一共展示了IWindowManager.ShowDialog方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AlbumViewModel
public AlbumViewModel(Album album)
{
_events = IoC.Get<IEventAggregator>();
_windowManager = IoC.Get<IWindowManager>();
Model = album;
Tracks = new ReactiveList<TrackViewModel>();
Tracks.AddRange(album.Tracks.Select(x => new TrackViewModel(x)));
AddAlbumToPlaylistCommand = new ReactiveCommand();
AddAlbumToPlaylistCommand.Subscribe(param => _events.Publish(Tracks.Select(x => x.Track).ToList()));
EditorEditAlbumsCommand = new ReactiveCommand();
EditorEditAlbumsCommand.Subscribe(
param => _windowManager.ShowDialog(new AlbumTagEditorViewModel(Tracks.Select(x => x.Track.Model).ToList())));
}
示例2: ArtistViewModel
public ArtistViewModel(Artist artist)
{
Model = artist;
Albums = artist.Albums;
_events = IoC.Get<IEventAggregator>();
_windowManager = IoC.Get<IWindowManager>();
AddArtistToPlaylistCommand = new ReactiveCommand();
AddArtistToPlaylistCommand.Subscribe(
param => _events.Publish(Albums.SelectMany(x => x.Tracks).Select(x => x).ToList()));
EditorEditArtistsCommand = new ReactiveCommand();
EditorEditArtistsCommand.Subscribe(param => _windowManager.ShowDialog(
new ArtistTagEditorViewModel(Albums.SelectMany(x => x.Tracks).Select(x => x.Model).ToList())));
}
示例3: ShowAddNewUser
public static void ShowAddNewUser(SimpleContainer container, IWindowManager windowManager)
{
var askUser =
container.GetInstance(typeof(SpecifyValueViewModel),
"SpecifyValueViewModel") as
SpecifyValueViewModel;
if (askUser == null)
{
Common.ShowMessageBox("EPIC FAIL", "RUN AROUND WITH NO REASON",
false, true);
return;
}
askUser.ShowComboBox = false;
askUser.Message = "Please enter your username (this will be used to log changes made to the data)";
askUser.Title = "Add New User";
windowManager.ShowDialog(askUser);
var user = askUser.Text;
if (!String.IsNullOrWhiteSpace(user))
{
UserHelper.Add(user);
}
}
示例4: RequestReason
public static ChangeReason RequestReason(SimpleContainer container, IWindowManager windowManager, int defaultReasonNumber)
{
var specify = (SpecifyValueViewModel)container.GetInstance(typeof(SpecifyValueViewModel), "SpecifyValueViewModel");
specify.Title = "Log Reason";
specify.Message = "Please specify a reason for this change:";
specify.ShowComboBox = true;
specify.ComboBoxItems = ChangeReason.ChangeReasons.Where(x => !x.Reason.StartsWith("[Importer]")).Select(x => x.Reason).ToList();
specify.ShowCancel = true;
var defaultReason = ChangeReason.ChangeReasons.FirstOrDefault(x => x.ID == defaultReasonNumber);
if (defaultReason != null)
specify.ComboBoxSelectedIndex = specify.ComboBoxItems.IndexOf(defaultReason.Reason);
windowManager.ShowDialog(specify);
if (specify.WasCanceled)
return null;
return ChangeReason.ChangeReasons.FirstOrDefault(x => x.Reason == specify.Text) ?? ChangeReason.AddNewChangeReason(specify.Text);
}
示例5: Execute
public void Execute(IWindowManager windowManager, IQuestionDialog questionDialog)
{
var question = new Question(
null,
Text,
_possibleAnswers
);
questionDialog.Setup(
Caption,
new[] {question}
);
questionDialog.WasShutdown += delegate{
if(_handleResult != null)
_handleResult(question.Answer);
else if(question.Answer == Answer.No || question.Answer == Answer.Cancel)
{
Completed(this, new CancelResult());
return;
}
Completed(this, null);
};
windowManager.ShowDialog(questionDialog, null, null);
}
示例6: MantenerAlmacenViewModel
public MantenerAlmacenViewModel(IWindowManager windowmanager)
{
_windowManager = windowmanager;
uSQL = new UbigeoSQL();
tSQL = new TiendaSQL();
pxaSQL = new ProductoSQL();
aSQL = new AlmacenSQL();
tzSQL = new TipoZonaSQL();
int existe = aSQL.existeCentral();
Editar = true;
if (existe > 0)
{
Almacenes central = aSQL.BuscarAlmacen(-1, -1, 3);
accion = 2;
Editar = false;
/* idTienda = t.IdTienda; */
/*carga de la informacion general*/
TxtNombre = central.Nombre;
TxtTelefono = central.Telefono;
TxtDir = central.Direccion;
List<Ubigeo> u = uSQL.buscarUbigeo2(central.IdUbigeo);
/*carga de los combobox*/
CmbDpto = uSQL.BuscarDpto();
Index1 = CmbDpto.FindIndex(x => x.CodDpto == u[0].CodDpto);
SelectedDpto = u[0].CodDpto;
Index2 = CmbProv.FindIndex(x => x.CodProv == u[0].CodProv);
SelectedProv = u[0].CodProv;
Index3 = CmbDist.FindIndex(x => x.CodDist == u[0].CodDist);
Content = "Ver distribución";
TxtNumColumns = central.NroColumnas.ToString();
TxtNumRows = central.NroFilas.ToString();
TxtAltura = central.Altura.ToString();
lstZonas = tzSQL.ObtenerZonasxAlmacen(central.IdAlmacen, 3);
_windowManager.ShowDialog(new AlertViewModel(_windowManager, "El almacen central ya existe"));
}
else if (existe == 0)
{
CmbZonas = (new TipoZonaSQL()).BuscarZona();
CmbDpto = uSQL.BuscarDpto();
Content = "Generar distribución";
}
else
{
_windowManager.ShowDialog(new AlertViewModel(_windowManager, "Ocurrió un problema"));
}
}
示例7: CreateNewCase
public static bool CreateNewCase(object rootModel, IWindowManager windowManager)
{
_logger.InfoFormat("Creating a new case");
return windowManager.ShowDialog(rootModel).GetValueOrDefault(false);
}