public SelectItem SelectItemDialog(string caption, string message, bool filterVisible, params SelectItem[] items)
        {
            SelectItem result = null;

            Execute.OnUIThread(() =>
            {
                var vm = new SelectItemDialogViewModel
                {
                    DisplayName      = caption,
                    Message          = message,
                    SelectButtonText = SelectButtonText,
                    CancelButtonText = CancelButtonText,
                    FilterLabel      = FilterLabel,
                    FilterVisible    = filterVisible,
                };
                vm.Items.AddRange(items.Select(_ => new SelectItemViewModel(_)));
                var res = _windowManager.ShowDialog(vm);
                if (res == true && vm.SelectedItem != null)
                {
                    result = vm.SelectedItem.Model;
                }
            });

            return(result);
        }
 public SelectItemViewModel(SelectItem model)
 {
     _model = model;
 }
Exemple #3
0
 public SelectItemViewModel(SelectItem model)
 {
     _model = model;
 }