Example #1
0
 public void SetUp()
 {
     _mockStartMenuViewModel      = new Mock <IStartMenuViewModel>();
     _mockNavigationTreeViewModel = new Mock <INavigationTreeViewModel>();
     _mockApplicationStateService = new Mock <IApplicationStateService>();
     _viewModel = new NavigationPaneViewModel(
         _mockStartMenuViewModel.Object,
         _mockNavigationTreeViewModel.Object,
         _mockApplicationStateService.Object);
 }
Example #2
0
            public SelectedToolViewModel(UIView toolboxView, AvailableToolsContainerViewController container, MeetingViewModel meeting, IReactiveList <IToolViewModel> selectedTools, NavigationPaneViewModel navigationPane)
            {
                SelectedTools = selectedTools;

                IsEmpty = SelectedTools.Count == 0;
                SelectedTools.Changed.ObserveOn(RxApp.MainThreadScheduler)
                .Subscribe(p =>
                {
                    IsEmpty = SelectedTools.Count == 0;
                });

                var showAvailableToolsCommand = new ReactiveCommand();

                showAvailableToolsCommand.ObserveOn(RxApp.MainThreadScheduler).Subscribe(_ =>
                {
                    UIView.BeginAnimations(null);
                    UIView.SetAnimationDuration(0.25);
                    toolboxView.Alpha = 1.0f;
                    UIView.CommitAnimations();
                });

                container.CloseToolboxRequested += (s, e) =>
                {
                    UIView.BeginAnimations(null);
                    UIView.SetAnimationDuration(0.25);
                    toolboxView.Alpha = 0.0f;
                    UIView.CommitAnimations();
                };
                ShowAvailableToolsCommand            = showAvailableToolsCommand;
                navigationPane.ShowToolLibraryAction = () => ShowAvailableToolsCommand.Execute(null);

                var setActiveToolsCommand = new ReactiveCommand();

                setActiveToolsCommand.ObserveOn(RxApp.MainThreadScheduler)
                .Subscribe(tool => meeting.ActiveTool = (IToolViewModel)tool);
                SetActiveToolCommand = setActiveToolsCommand;
            }