Ejemplo n.º 1
0
        public DoctorsWindowVM()
        {
            _user = new User()
            {
                Id        = 1,
                Login     = "******",
                FirstName = "Piotr",
                LastName  = "Bakun",
                isActive  = true,
                Email     = "*****@*****.**"
            };

            //Create new QueueData with default values and initials in
            _queueData = new QueueDataBuilder().WithUserInitials(String.Concat(_user.FirstName.First(), _user.LastName.First())).WithRoomNo(12).Build();
            //Call QueueSystem service
            _queueService = new QueueServiceAPI(_queueData, _user);

            //Commands
            _connectCommand               = new ConnectCommand(this);
            _disconnectCommand            = new DisconnectCommand(this);
            _nextPersonCommand            = new NextPersonCommand(this);
            _previousPersonCommand        = new PreviousPersonCommand(this);
            _forceNewPersonCommand        = new ForceNewPersonCommand(this);
            _breakCommand                 = new BreakCommand(this);
            _sendAdditionalMessageCommand = new SendAdditionalMessageCommand(this);
            _clearRichTextBoxCommand      = new ClearRichTextBoxCommand(this);

            //Initiate data for View (UI)
            ViewData = new DoctorsViewData(_queueData);


            _queueData.PropertyChanged += _queueData_PropertyChanged;

            //Generate UI stuff for designing xaml
            if (DesignerProperties.GetIsInDesignMode(new System.Windows.DependencyObject()))
            {
                _queueData = new QueueData()
                {
                    QueueNoMessage    = "PB01",
                    AdditionalMessage = "Some additional Message",
                    Owner             = "piotr.bakun",
                };
            }
        }
Ejemplo n.º 2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            //Create custom principal with an anonymous identity
            CustomPrincipal customPrincipal = new CustomPrincipal();

            AppDomain.CurrentDomain.SetThreadPrincipal(customPrincipal);
            IocKernel.Initialize(new IocConfiguration());
            base.OnStartup(e);

            IQueueServiceAPI queueServiceApi = new QueueServiceAPI();
            IView            doctorsWindow   = new DoctorsWindow(new DoctorsWindowVM(queueServiceApi));

            doctorsWindow.Show();

            //Show login view
            //LoginVM VM = new LoginVM(new AuthenticationService(queueServiceApi));
            //IView loginWindow = new LoginWindow(VM);
            //loginWindow.Show();
        }