public FilterSessionsViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService, IUnityContainer container)
            : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService)
        {
            _container   = container;
            _allCategory = new open.conference.app.DataStore.Abstractions.DataObjects.Category
            {
                Name       = "All",
                IsEnabled  = true,
                IsFiltered = Settings.ShowAllCategories
            };

            _allCategory.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "IsFiltered")
                {
                    SetShowAllCategories(_allCategory.IsFiltered);
                }
            };

            ToolBarItems.Add(new ToolbarItem
            {
                Text    = "Done",
                Command = DoneCommand,
                Icon    = Device.OS != TargetPlatform.iOS ? "toolbar_close.png" : null
            });
        }
        protected sealed override void SetToolBarItems()
        {
            var saveButton = new FmSaveBarButtonItem();

            saveButton.ItemClick += SaveButtonOnItemClick;
            ToolBarItems.Add(saveButton.Name, saveButton);
        }
Ejemplo n.º 3
0
 public LoginViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService)
     : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService)
 {
     if (!Settings.FirstRun)
     {
         Title = "My Account";
         var cancel = new ToolbarItem
         {
             Text    = "Cancel",
             Command = DelegateCommand.FromAsyncHandler(async() =>
             {
                 if (IsBusy)
                 {
                     return;
                 }
                 await Finish();
                 Settings.FirstRun = false;
             }).ObservesCanExecute((arg) => IsBusy)
         };
         if (Device.OS != TargetPlatform.iOS)
         {
             cancel.Icon = "toolbar_close.png";
         }
         ToolBarItems.Add(cancel);
     }
 }
Ejemplo n.º 4
0
        public FeedViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService)
            : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService)
        {
            NextForceRefresh = DateTime.UtcNow.AddMinutes(45);
            if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
            {
                ToolBarItems.Add(new ToolbarItem
                {
                    Text    = "Refresh",
                    Icon    = "toolbar_refresh.png",
                    Command = RefreshCommand
                });
            }
            LoggedIn = Settings.Email;

            Tweets.CollectionChanged += (sender, e) =>
            {
                TweetListHeightAdjustment = Tweets.Count;
            };

            Sessions.CollectionChanged += (sender, e) =>
            {
                SessionListHeightAdjustment = Sessions.Count;
            };
            Workshops.CollectionChanged += (sender, e) =>
            {
                WorkshopListHeightAdjustment = Workshops.Count;
            };
        }
        private void AddCustomToolBarItems()
        {
            var productCategoryButtonItem = new BarButtonItem
            {
                Name    = "ProductCategory",
                Content = "دسته بندی",
                Glyph   = ImageUtility.CreateSvgImage("Icons/NavigationBar/ProductCategory_Large.svg"),
            };

            productCategoryButtonItem.ItemClick += ProductCategoryButtonItemOnItemClick;
            ToolBarItems.Add("ProductCategory", productCategoryButtonItem);
        }
Ejemplo n.º 6
0
 private void Setup()
 {
     if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
     {
         ToolBarItems.Add(new ToolbarItem
         {
             Text    = "Refresh",
             Icon    = "toolbar_refresh.png",
             Command = ForceRefreshCommand
         });
     }
 }
Ejemplo n.º 7
0
        private void CreateCancelToolBar(IToolBarService toolBarService)
        {
            var cancelToolBarItem = toolBarService.CreateToolBarButtonItem();

            cancelToolBarItem.DisplayName = "Cancel";
            cancelToolBarItem.ImageName   = IconNames.CANCEL;
            cancelToolBarItem.Command     = ClosingStrategy.CloseCommand;

            ToolBarItems.Add(cancelToolBarItem);

            this.SyncToolBarItemWithViewModelActivationState(cancelToolBarItem).AddDisposable(Disposables);
        }
Ejemplo n.º 8
0
 public EventsViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService)
     : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService)
 {
     Title = "Events";
     if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
     {
         ToolBarItems.Add(new ToolbarItem
         {
             Text    = "Refresh",
             Icon    = "toolbar_refresh.png",
             Command = ForceRefreshCommand
         });
     }
 }
Ejemplo n.º 9
0
        private void CreateToolBar(Func <ToolBarButtonItem> toolBarButtonItemFactory)
        {
            var saveToolBarItem = toolBarButtonItemFactory();

            saveToolBarItem.DisplayName = "Save";
            saveToolBarItem.Command     = new DelegateCommand(Save);
            ToolBarItems.Add(saveToolBarItem);

            var cancelToolBarItem = toolBarButtonItemFactory();

            cancelToolBarItem.DisplayName = "Cancel";
            cancelToolBarItem.Command     = new DelegateCommand(ClosingStrategy.Close);
            ToolBarItems.Add(cancelToolBarItem);
        }
Ejemplo n.º 10
0
        public TweetImageViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService)
            : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService)
        {
            EventAggregator.GetEvent <TweetImageChangedEvent>().Subscribe(ImageChanged);
            var item = new ToolbarItem
            {
                Text    = "Done",
                Command = DelegateCommand.FromAsyncHandler(async() => await Navigation.GoBackAsync())
            };

            if (Device.OS == TargetPlatform.Android)
            {
                item.Icon = "toolbar_close.png";
            }
            ToolBarItems.Add(item);
        }
Ejemplo n.º 11
0
 public SponsorsViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService)
     : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService)
 {
     if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
     {
         ToolBarItems.Add(new ToolbarItem
         {
             Text    = "Refresh",
             Icon    = "toolbar_refresh.png",
             Command = ForceRefreshCommand
         });
     }
     if (Device.OS == TargetPlatform.Android)
     {
         Effects.Add("open.conference.app.ListViewSelectionOnTopEffect");
     }
 }
        protected sealed override void SetToolBarItems()
        {
            var addButton = new FmAddBarButtonItem();

            addButton.ItemClick += AddButtonOnToolBarItemClick;
            var editButton = new FmEditBarButtonItem();

            editButton.ItemClick += EditButtonOnToolBarItemClick;
            var deleteButton = new FmDeleteBarButtonItem();

            deleteButton.ItemClick += DeleteButtonOnToolBarItemClick;
            ToolBarItems.Add(addButton.Name, addButton);
            ToolBarItems.Add(editButton.Name, editButton);
            ToolBarItems.Add(deleteButton.Name, deleteButton);

            ToolBarItems.ChangeToolBarItemStatus("Edit", false);
            ToolBarItems.ChangeToolBarItemStatus("Delete", false);
        }
        protected sealed override void SetToolBarItems()
        {
            var addButton = new FmAddBarButtonItem();

            addButton.ItemClick += AddButtonOnToolBarItemClick;
            var saveButton = new FmSaveBarButtonItem();

            saveButton.ItemClick += SaveButtonOnToolBarItemClick;
            var deleteButton = new FmDeleteBarButtonItem();

            deleteButton.ItemClick += DeleteButtonOnToolBarItemClick;
            var separatorButton = new BarItemSeparator();

            ToolBarItems.Add(addButton.Name, addButton);
            ToolBarItems.Add(saveButton.Name, saveButton);
            ToolBarItems.Add(deleteButton.Name, deleteButton);
            ToolBarItems.Add("FirstSeparator", separatorButton);
        }
Ejemplo n.º 14
0
        private void CreateSaveToolBar(IToolBarService toolBarService)
        {
            var saveCommand = new ObservableCommand(Model.IsValid);

            saveCommand.Executed
            .ObserveOn(Scheduler.Task.RX)
            .SelectMany(_ => _service.SaveAsync()
                        .ToObservable()
                        .TakeUntil(BusyViewModel.BusyLatch))
            .TakeUntil(ClosingStrategy.Closed)
            .Subscribe(_ => { });

            var saveToolBarItem = toolBarService.CreateToolBarButtonItem();

            saveToolBarItem.DisplayName = "Save";
            saveToolBarItem.ImageName   = IconNames.SAVE;
            saveToolBarItem.Command     = saveCommand;

            ToolBarItems.Add(saveToolBarItem);

            this.SyncToolBarItemWithViewModelActivationState(saveToolBarItem).AddDisposable(Disposables);
        }
Ejemplo n.º 15
0
 public void AddToolbarItem(ToolBarItem toolbarItem)
 {
     ToolBarItems.Add(toolbarItem);
     StateHasChanged();
 }
Ejemplo n.º 16
0
        public VenueViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService)
            : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService)
        {
            if (Device.OS == TargetPlatform.Android)
            {
                ToolBarItems.Add(new ToolbarItem
                {
                    Order   = ToolbarItemOrder.Secondary,
                    Text    = "Get Directions",
                    Command = NavigateCommand
                });

                if (CanMakePhoneCall)
                {
                    ToolBarItems.Add(new ToolbarItem
                    {
                        Order   = ToolbarItemOrder.Secondary,
                        Text    = "Call Hotel",
                        Command = CallCommand
                    });
                }
            }
            else if (Device.OS == TargetPlatform.iOS)
            {
                ToolBarItems.Add(new ToolbarItem
                {
                    Text    = "More",
                    Icon    = "toolbar_overflow.png",
                    Command = DelegateCommand <object> .FromAsyncHandler(async(o) =>
                    {
                        string[] items = null;
                        if (!CanMakePhoneCall)
                        {
                            items = new[] { "Get Directions" };
                        }
                        else
                        {
                            items = new[] { "Get Directions", "Call +49 (341) 4859270" };
                        }
                        var action = await PageDialogService.DisplayActionSheetAsync("Commundo Tagungshotel", "Cancel", null, items);
                        if (action == items[0])
                        {
                            NavigateCommand.Execute(null);
                        }
                        else if (items.Length > 1 && action == items[1] && CanMakePhoneCall)
                        {
                            CallCommand.Execute(null);
                        }
                    })
                });
            }
            else
            {
                ToolBarItems.Add(new ToolbarItem
                {
                    Text    = "Directions",
                    Command = NavigateCommand,
                    Icon    = "toolbar_navigate.png"
                });

                if (CanMakePhoneCall)
                {
                    ToolBarItems.Add(new ToolbarItem
                    {
                        Text    = "Call",
                        Command = CallCommand,
                        Icon    = "toolbar_call.png"
                    });
                }
            }
            var position = new Position(Latitude, Longitude);

            MapSpan = new MapSpan(position, 0.02, 0.02);
            Pins.Add(new Pin
            {
                Type     = PinType.Place,
                Address  = LocationTitle,
                Label    = EventTitle,
                Position = position
            });
        }