public ConfigureViewModel(IWallpaperRepository database, IMetroDialog metroDialog) { DisplayName = "Configure WallMixer"; _db = database; _dialog = metroDialog; Sources = new BindableCollection <WallpaperSource>(); }
public MainViewModel(IWindowManager manager, IWallpaperRepository db, IMetroDialog dialog) { _windowManager = manager; _db = db; _dialog = dialog; _rand = new Random(); new Task(ChangeWallpaper).Start(); }
static async Task <bool?> HandleMetroDialog(IMetroDialog model, BaseMetroDialog dialog) { var window = (MetroWindow)Application.Current.MainWindow; var tcs = new TaskCompletionSource <bool?>(); model.Close = CreateCommand(dialog, window, tcs); await window.ShowMetroDialogAsync(dialog); return(await tcs.Task); }
public static async Task <bool> DoneOrCancelVisitor(this IMetroDialog metroDialog, string operation) { return((await metroDialog.ShowMessage("Done or cancel", $"Are you done {operation} or do you want to cancel the visitor card", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings { AffirmativeButtonText = "Done", NegativeButtonText = "Cancel" })) == MessageDialogResult.Affirmative); }
/// <summary> /// DO NOT CALL .RESULT or .WAIT from UI thread! /// </summary> /// <param name="model"></param> /// <returns></returns> protected async Task <bool?> ShowMetroDialog(IMetroDialog model) { // Da faq mahapps!!! var resolvedView = ViewLocator.Current.ResolveView(model); resolvedView.ViewModel = model; var view = resolvedView as BaseMetroDialog; if (view != null) { return(await HandleMetroDialog(model, view)); } var dialog = new CustomDialog { Content = resolvedView }; using (model.WhenAnyValue(x => x.DisplayName).BindTo(dialog, x => x.Title)) return(await HandleMetroDialog(model, dialog)); }
public Task<bool?> ShowMetroDialog(IMetroDialog vm) { Contract.Requires<ArgumentNullException>(vm != null); return default(Task<bool?>); }
public MainMenuViewModel(INavigationService navigationService, IMetroDialog metroDialog) { _navigationService = navigationService; _metroDialog = metroDialog; }
public Task<bool?> ShowMetroDialog(IMetroDialog vm) { throw new NotImplementedException(); }
public PlayerSelection(IMetroDialog metroDialog, IMefContainer mefContainer) { _metroDialog = metroDialog; _mefContainer = mefContainer; }
static async Task<bool?> HandleMetroDialog(IMetroDialog model, BaseMetroDialog dialog) { var window = (MetroWindow) Application.Current.MainWindow; var tcs = new TaskCompletionSource<bool?>(); model.Close = CreateCommand(dialog, window, tcs); await window.ShowMetroDialogAsync(dialog); return await tcs.Task; }
public BuildStructureAction(IEventAggregator eventAggregator, IMetroDialog metroDialog, IMefContainer mefContainer) : base(eventAggregator) { _metroDialog = metroDialog; _mefContainer = mefContainer; }
protected PlayVisitorAction(IEventAggregator eventAggregator, IMetroDialog metroDialog, IMefContainer mefContainer) : base(eventAggregator) { _metroDialog = metroDialog; _mefContainer = mefContainer; }
public PlayWinterVisitorAction(IEventAggregator eventAggregator, IMetroDialog metroDialog, IMefContainer mefContainer) : base(eventAggregator, metroDialog, mefContainer) { }
public PlantVineAction(IEventAggregator eventAggregator, IMetroDialog metroDialog, IMefContainer mefContainer) : base(eventAggregator) { _metroDialog = metroDialog; _mefContainer = mefContainer; }
public SellGrapeOrFieldAction(IEventAggregator eventAggregator, IMetroDialog metroDialog, IMefContainer mefContainer) : base(eventAggregator) { _metroDialog = metroDialog; _mefContainer = mefContainer; }
public FillOrderAction(IEventAggregator eventAggregator, IMetroDialog metroDialog, IMefContainer mefContainer) : base(eventAggregator) { _metroDialog = metroDialog; _mefContainer = mefContainer; }
/// <summary> /// DO NOT CALL .RESULT or .WAIT from UI thread! /// </summary> /// <param name="model"></param> /// <returns></returns> public async Task<bool?> ShowMetroDialog(IMetroDialog model) { ConfirmAccess(); // Da faq mahapps!!! var resolvedView = ViewLocator.Current.ResolveView(model); resolvedView.ViewModel = model; var view = resolvedView as BaseMetroDialog; if (view != null) return await HandleMetroDialog(model, view); var dialog = new CustomDialog {Content = resolvedView}; using (model.WhenAnyValue(x => x.DisplayName).BindTo(dialog, x => x.Title)) return await HandleMetroDialog(model, dialog); }