public TransportSelectionViewModel(IRepoManager repoManager, INavigation navigation, ITransportationModeConfiguration transportConfiguration, TrackEntry trackEntry) { _repoManager = repoManager ?? throw new ArgumentNullException(nameof(repoManager)); _navigation = navigation ?? throw new ArgumentNullException(nameof(navigation)); _trackEntry = trackEntry ?? throw new ArgumentNullException(nameof(trackEntry)); _transportConfig = transportConfiguration ?? throw new ArgumentNullException(nameof(transportConfiguration)); Items = new SelectableObservableCollection <TransportModeItem>(); SaveCommand = new Command(async() => { FinishedTransportSelection(); await _navigation.PopModalAsync(); }); CancelCommand = new Command(async() => { await _navigation.PopModalAsync(); }); CustomTransportModeCommand = new Command(async() => { await _navigation.PushModalAsync(new NavigationPage(new CustomTransportSelectionPage(Items))); }); SetActualTransportModes(); }
public MultiSelectPage() { InitializeComponent(); var initialItems = new[] { "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th" }; enableMultiSelect = true; Items = new SelectableObservableCollection <string>(initialItems); AddItemCommand = new Command(OnAddItem); //RemoveSelectedCommand = new Command(OnRemoveSelected); //ToggleSelectionCommand = new Command(OnToggleSelection); SelectAllCommand = new Command(OnSelectAll); SendCommand = new Command(OnSend); BindingContext = this; hubConnection = new HubConnectionBuilder() .WithUrl(App.hubAddress) .Build(); //hubConnection.On<double, double, double, string>("New Prescribe", (X, Y, dateOf, phoneNo) => //{ // string _phoneNo = phoneNo; // // DisplayAlert("Ouch", prescribe.DateOf.ToString() + "\n" + prescribe.PhoneNo, "OK"); //}); }
public RegionSelectionPage() { InitializeComponent(); this.Title = "Change Regions"; Regions regions = new Regions(); Items = new SelectableObservableCollection <Region>(regions.AvailableRegions); List <Region> itemsToMove = new List <Region>(); int[] selectedRegions = Settings.SelectedRegions; foreach (var item in Items) { foreach (var regId in selectedRegions) { if (regId == item.Data.Id) { item.IsSelected = true; itemsToMove.Add(item.Data); break; } } } int newIndex = 0; // Move our selected items to the top of the list foreach (var item in itemsToMove) { int origIdx = Items.IndexOf(item); Items.Move(origIdx, newIndex++); } BindingContext = this; }
public ConfigurationTabVM(ControllerClient controllerClient, UnhandledExceptionPresenter unhandledExceptionPresenter) { if (controllerClient == null) { throw new ArgumentNullException(nameof(controllerClient)); } if (unhandledExceptionPresenter == null) { throw new ArgumentNullException(nameof(unhandledExceptionPresenter)); } _controllerClient = controllerClient; _unhandledExceptionPresenter = unhandledExceptionPresenter; Areas = new SelectableObservableCollection <AreaItemVM>(); RefreshCommand = new AsyncDelegateCommand(RefreshAsync); SaveCommand = new AsyncDelegateCommand(SaveAsync); MoveAreaUpCommand = new DelegateCommand(MoveAreaUp); MoveAreaDownCommand = new DelegateCommand(MoveAreaDown); MoveActuatorUpCommand = new DelegateCommand(MoveActuatorUp); MoveActuatorDownCommand = new DelegateCommand(MoveActuatorDown); }
public CustomTransportSelectionViewModel(INavigation navigation, SelectableObservableCollection <Model.TransportModeItem> activeItems) { _navigation = navigation ?? throw new ArgumentNullException(nameof(navigation)); _activeItems = activeItems ?? throw new ArgumentNullException(nameof(activeItems)); SaveCommand = new Command(async() => { if (Text.Contains(",")) { await Acr.UserDialogs.UserDialogs.Instance.AlertAsync(AppResources.CommaRestrictionText, AppResources.CommaRestrictionTitle, AppResources.OkText); } else { activeItems.Add(new Model.TransportModeItem() { Id = Text, Name = Text }, true); await _navigation.PopModalAsync(); } }); CancelCommand = new Command(async() => { await _navigation.PopModalAsync(); }); }
public CustomTransportSelectionPage(SelectableObservableCollection <Model.TransportModeItem> items) { if (Device.RuntimePlatform == Device.iOS) { ExtendedToolbarItem saveToolbarItem = new ExtendedToolbarItem() { Done = true, Text = AppResources.SaveText }; saveToolbarItem.SetBinding(ExtendedToolbarItem.CommandProperty, "SaveCommand"); ToolbarItems.Add(saveToolbarItem); } ExtendedToolbarItem cancelToolbarItem = new ExtendedToolbarItem() { Left = true, Text = AppResources.CancelText }; cancelToolbarItem.SetBinding(ExtendedToolbarItem.CommandProperty, "CancelCommand"); ToolbarItems.Add(cancelToolbarItem); InitializeComponent(); BindingContext = App.Container.Resolve <CustomTransportSelectionViewModel>( new TypedParameter(typeof(INavigation), Navigation), new NamedParameter("activeItems", items)); }
/** update item */ private void OnUpdate() { List <DbModel> dBItems = manager.GetAll().ToList(); Items = new SelectableObservableCollection <DbModel>(dBItems); lstDB.ItemsSource = Items; BindingContext = this; }
protected ConfigurationItemVM(string id) { if (id == null) { throw new ArgumentNullException(nameof(id)); } Id = id; Settings = new SelectableObservableCollection <SettingItemVM>(); }
/** SearchBar */ private void SearchBar_TextChanged(object sender, TextChangedEventArgs e) { var keyboard = PersonSearchBar.Text; var dBItems = manager.GetAll().Where(x => x.Name.ToLower().Contains(keyboard.ToLower())).ToList(); var result = dBItems.Count(); if (result > 0) { Items = new SelectableObservableCollection <DbModel>(dBItems); lstDB.ItemsSource = Items; } }
public ControllerSelectorVM() { Controllers = new SelectableObservableCollection <ControllerItemVM>(); _discoveryClient.ResponseReceived += EnlistController; AcceptCommand = new DelegateCommand(Accept, () => Controllers.SelectedItem != null); CancelCommand = new DelegateCommand(Cancel); UseFromAppConfigCommand = new DelegateCommand(AcceptFromAppConfig); Controllers.NotifyCommandIfSelectionChanged(AcceptCommand); }
public MainPageTabbed() { InitializeComponent(); camera = (CircleImage)FindByName("Camera"); camera.Source = ImageSource.FromResource("KooshDaroo.Customer.Images.camera.jpg"); gallery = (CircleImage)FindByName("Gallery"); gallery.Source = ImageSource.FromResource("KooshDaroo.Customer.Images.gallery.jpg"); send = (CircleImage)FindByName("Send"); send.Source = ImageSource.FromResource("KooshDaroo.Customer.Images.send.jpg"); prescribeimage = (Image)FindByName("PrescribeImage"); PrescribeList = new List <Prescribe>(); responseS = new SelectableObservableCollection <Response>(); //var _r = new Response //{ // NDI = "8:8", // Tag = "154" //}; //responseS.Add(_r); //RemoveSelectedCommand = new Command(OnRemoveSelected); RouteToPharmacyCommand = new Command(OnRouteToPharmacy); AcceptCommand = new Command(OnAccept); BindingContext = this; hubConnection = new HubConnectionBuilder() .WithUrl(App.hubAddress) .Build(); //hubConnection.On<double, double, DateTime, string>("New Prescribe", (X, Y, dateOf, phoneNo) => //{ // string _phoneNo = phoneNo; // // DisplayAlert("Ouch", prescribe.DateOf.ToString() + "\n" + prescribe.PhoneNo, "OK"); //}); hubConnection.On <int, int>("SendAcceptToMember", (prescribeResourceId, prescribeId) => { if (_prescribeId != prescribeId) { return; } GetPrescribeResourseData(prescribeResourceId); }); //GetPrescribeResourseData(23); }
private void RetrieveDeliveryOrders() { Orders = new SelectableObservableCollection <DeliveryOrder>(); string[] mockPickTickets = { "123456", "654321", "098765", "109283", "657483", "109283", "384756", "209384", "5682038", "797451" }; foreach (var pickTicket in mockPickTickets) { Orders.Add(new DeliveryOrder { PickTicketNumber = pickTicket }); } }
public Tasks() { SPTasksURL = string.Format(SPTasksURL, ClientConfiguration.Default.ActiveDirectoryResource); InitializeComponent(); enableMultiSelect = true; Items = new SelectableObservableCollection <Result>(new List <Result>()); //AddItemCommand = new Command(OnAddItem); RemoveSelectedCommand = new Command(OnRemoveSelected); ToggleSelectionCommand = new Command(OnToggleSelection); BindingContext = this; }
public MainPageTabbed() { InitializeComponent(); On <Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom); page01.IconImageSource = ImageSource.FromResource("KooshDaroo.Pharmacy.Images.gallery.jpg"); page02.IconImageSource = ImageSource.FromResource("KooshDaroo.Pharmacy.Images.gallery.jpg"); page03.IconImageSource = ImageSource.FromResource("KooshDaroo.Pharmacy.Images.gallery.jpg"); //UpdateList(30.292121, 57.067799, 43811.82505482639); responseS = new SelectableObservableCollection <Prescription>(); //var _r = new Prescription //{ // DateAndDistance = "8:8", // Tag = "154" //}; //responseS.Add(_r); hubConnection = new HubConnectionBuilder() .WithUrl(App.hubAddress) .Build(); hubConnection.On <double, double, DateTime, int>("SendPrescribeToPharmacy", (X, Y, dateOf, prescribeId) => { UpdateList(X, Y, dateOf, prescribeId); }); //hubConnection.On<string>("New Message", (message) => //{ // string a = message; //}); hubConnection.On <int>("SendAcceptToPharmacy", (prescribeResourceId) => { //UpdateList(0, 0, DateTime.FromOADate(0), id, false); AddFinalizedPrescription(prescribeResourceId); }); hubConnection.On <int, int>("SendAcceptToMember", (prescribeResourceId, prescribeId) => { UpdateList(0, 0, DateTime.FromOADate(0), prescribeId, false); }); StartConnectionToHub(); //await hubConnection.SendAsync("SendPrescribeToPharmacy", prescribes.PhoneNo, prescribes.DateOf); BindingContext = this; }
private async void GetAmenities() { var amenities = await APIService.GetAmenities(); List <AmenityModel> amenitiesModels = amenities .Select(x => new AmenityModel { AmenityId = x.AmenityId, Name = x.Name }).ToList(); var amenitiesItems = amenitiesModels .Select(x => new SelectableItem <AmenityModel>(x)) .ToList(); AmenitiesItems = new SelectableObservableCollection <SelectableItem <AmenityModel> >(amenitiesItems); lvAmenities.ItemsSource = AmenitiesItems; }
public MultiSelectDemo() { InitializeComponent(); var initialItems = new[] { "אוכל", "חינוך", "נקיון", "שיפוצים", "הדרכה", "גינון", "הובלה", "כלים כבדים", "ביביסיטר", "עבודות בית", "אדמיניסטרציה", "שיווק", "רסר", "הפקה" }; enableMultiSelect = true; Items = new SelectableObservableCollection <string>(initialItems); AddItemCommand = new Command(OnAddItem); RemoveSelectedCommand = new Command(OnRemoveSelected); ToggleSelectionCommand = new Command(OnToggleSelection); BindingContext = this; }
public MainPage() { InitializeComponent(); var initialItems = new[] { "One", "Two", "Three", "Four", "Five" }; enableMultiSelect = true; Items = new SelectableObservableCollection <string>(initialItems); AddItemCommand = new Command(OnAddItem); RemoveSelectedCommand = new Command(OnRemoveSelected); ToggleSelectionCommand = new Command(OnToggleSelection); BindingContext = this; }
public Persons() { InitializeComponent(); manager = new SQLiteManager(); enableMultiSelect = true; dbModel = manager.GetAll().ToList(); Items = new SelectableObservableCollection <DbModel>(dbModel); Data(); lstDB.ItemsSource = Items; RemoveSelectedCommand = new Command(OnRemoveSelected); BindingContext = this; /* listview refresh*/ lstDB.RefreshCommand = new Command(() => { OnUpdate(); lstDB.IsRefreshing = false; }); }
public HealthTabVM(ControllerClient controllerClient) { if (controllerClient == null) { throw new ArgumentNullException(nameof(controllerClient)); } TraceItems = new SelectableObservableCollection <TraceItem>(); _controllerClient = controllerClient; _traceItemReceiverClient = new TraceItemReceiverClient(); _traceItemReceiverClient.TraceItemReceived += EnlistTraceItem; _traceItemReceiverClient.Start(); ClearCommand = new DelegateCommand(Clear); AutoScroll = new PropertyVM <bool>(true); ShowVerboseMessages = new PropertyVM <bool>(true); ShowInformations = new PropertyVM <bool>(true); ShowWarnings = new PropertyVM <bool>(true); ShowErrors = new PropertyVM <bool>(true); }
// Methods go here: public async Task <SelectableObservableCollection <Item> > refresh(string sortBy) { var items = await Item.GetItems(sortBy); Items = new SelectableObservableCollection <Item>(items); if (items.Count == 0) { // Display Empty View: MessagingCenter.Send <App>((App)Application.Current, Constants.DISPLAY_EMPTY_VIEW); } else if (items[0].Name.Contains("Unable to resolve host") || items[0].Name.Contains("Unexpected character")) { // Display network error: MessagingCenter.Send <App>((App)Application.Current, Constants.DISPLAY_NETWORK_ERROR); } else { // refresh Completed: MessagingCenter.Send((App)Application.Current, Constants.LISTVIEW_REFRESH_COMPLETE, Items); } return(Items); }
public PrescribeView() { InitializeComponent(); var initialItems = new[] { "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th" }; enableMultiSelect = true; Items = new SelectableObservableCollection <string>(initialItems); AddItemCommand = new Command(OnAddItem); RemoveSelectedCommand = new Command(OnRemoveSelected); ToggleSelectionCommand = new Command(OnToggleSelection); BindingContext = this; }
public MovselexGroup(IMovselexDatabaseAccessor databaseAccessor) { _databaseAccessor = databaseAccessor; GroupItems = new SelectableObservableCollection<GroupItem>(); }
/// <summary> /// 新しいインスタンスを初期化します。 /// </summary> public MovselexFiltering() { FilteringItems = new SelectableObservableCollection<FilteringItem>(); }
public CrearSolicitudTransporte(TipoSolicitudTransporte tp, Estudiante est) { InitializeComponent(); FechaMultipleHabilitada = tp.FechaMultipleHabilitada; CampoHoraHabilitada = tp.CampoHoraHabilitado; CampoDireccionHabilitado = tp.CampoDireccionHabilitado; BotonDireccionHabilitado = tp.BotonDireccionHabilitado; CampoCompaneroHabilitado = tp.CampoCompaneroHabilitado; CampoNombrePHabilitado = tp.CampoNombrePHabilitado; CampoIdentPHabilitado = tp.CampoIdentPHabilitado; CampoTelefonoHabilitado = tp.CampoTelefonoHabilitado; CampoObsHabilitado = tp.CampoObsHabilitado; //SwitchDireccion.IsToggled = true; //autocompleteCompañero.IsEnabled = false; codigoFamiliar = Convert.ToInt16(est.IdFamilia); IdTipoSolicitudTransporte = tp.IdTipoSolicitudTransporte; TipoIdentSolicitante = est.TipoIdentificacion; IdentificacionSolicitante = est.NumeroIdentificacion; Temporal = tp.Temporal; Permanente = tp.Permanente; Hora = TimePickerHora.Time; IdDireccion = null; //IdDireccion; IdentificacionCompanero = ""; TipoIdentCompanero = ""; NombreAutorizado = ""; IdentificacionAutorizado = ""; Telefono = null; JornadaMananaHabilitada = tp.JornadaMananaHabilitada; JornadaTardeHabilitada = tp.JornadaTardeHabilitada; JornadaExtraHabilitada = tp.JornadaExtraHabilitada; JornadaExtenHabilitada = tp.JornadaExtenHabilitada; Observaciones = MotivoEntry.Text; EstadoSolicitud = (tp.RequiereAutorizacion == true) ? "C" : "P"; UsuarioLog = GlobalVariables.Email; FechaSolicitud = FechaSolicitud; PeriodoLectivo = PeriodoLectivo; MotivoRechazo = MotivoRechazo; LblNombreSolicitud.Text = tp.NombreTipo; //TableSec.Title = tp.NombreTipo; //LblnombreTipoSolicitud.Text = tp.NombreTipo; //TblSectituloSol.Title = tp.NombreTipo; NombreEstudiante.Text = "Nombre: " + est.NombreCompleto; CursoEstudiante.Text = "Nombre: " + est.NombreCurso; FotoEstudiante.Source = est.UrlFoto; // NombreEstudiante.Detail = "Curso: " + est.NombreCurso; if (tp.FechaMultipleHabilitada == true) { FechaM.Text = tp.CampoFecha + " (*):"; FechaMultiple.IsVisible = true; Fecha.IsVisible = false; } else { FechaM.Text = tp.CampoFecha + " (*):"; FechaMultiple.IsVisible = false; Fecha.IsVisible = true; } if (tp.CampoHoraHabilitado == true) { LblHora.IsVisible = true; LblHora.Text = tp.CampoHora + " (*):"; TimePickerHora.IsVisible = true; } else { TableSec.Remove(cHora); LblHora.IsVisible = false; TimePickerHora.IsVisible = false; } if (tp.CampoTelefonoHabilitado == true) { TelefonoContactoEntry.Label = tp.CampoTelefono + " (*):"; } if (tp.CampoObsHabilitado == true) { MotivoEntry.Label = tp.CampoObservaciones + " (*):"; } if (tp.BotonDireccionHabilitado == true) { TableSectionEntregaEstudiante.Title = tp.CampoDestino; // TableSectionEntregaEstudiante.Remove(LugarEntregarCompañero); } else { FormularioSolicitud.Root.Remove(TableSectionEntregaEstudiante); TableSectionEntregaEstudiante.Remove(LugarEntregarDireccion); //TableSectionEntregaEstudiante.Remove(LugarEntregarCompañero); } if (tp.CampoNombrePHabilitado == true) { TableSectionPersonaAutorizada.Title = tp.CampoPersonaAutorizada; } else { FormularioSolicitud.Root.Remove(TableSectionPersonaAutorizada); } if (tp.CampoObsHabilitado == true) { TableSectionInformacion.Title = "Información"; } else { FormularioSolicitud.Root.Remove(TableSectionInformacion); } EjecutaTareaAsincrona1(); ConsultarDireccionesGrupo(null); EjecutaTareaAsincronaEstudiantes(); //TimePickerHora.SetBinding(TimePicker.TimeProperty, new Binding("StartDate", BindingMode.TwoWay)); Items = new SelectableObservableCollection <string>(arrFechas); RemoveSelectedCommand = new Command(OnRemoveSelected); SeleccionarFecha = new Command(OnFechaSelected); BindingContext = this; // bindableRadioGroupFechas.ItemsSource = arr4; }
void AdjustListViewHeight(ListView listView, SelectableObservableCollection <SelectionKeyItem> list) { var adjust = Xamarin.Forms.Device.RuntimePlatform != Xamarin.Forms.Device.Android ? 1 : -list.Count + 1; listView.HeightRequest = (list.Count * listView.RowHeight) - adjust; }
public AreaItemVM(string id) : base(id) { Actuators = new SelectableObservableCollection <ActuatorItemVM>(); Automations = new SelectableObservableCollection <AutomationItemVM>(); }