Example #1
0
 public LogIn(AuthenticationViewModel _viewMode)
 {
     ViewModel = _viewMode;
     InitializeComponent();
     //LoginImage.Source = new BitmapImage(new Uri(string.Format("\\Images\\cubes.png",System.Environment.CurrentDirectory), UriKind.RelativeOrAbsolute));
     //LoginImage.Source = new BitmapImage(new Uri("cubes.png", UriKind.Relative));
 }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        public App()
        {
            // Logger
            Iloggers = new List <csLogger>()
            {
                new csLogger("GUI"),
                new csLogger("")
            };
            MessageListener.Instance.ReceiveMessage(string.Format("Created system log"), 10);

            ICommGUI2RT = new Advanced.csCommunication();
            ICommGUI2RT.DataReceived   -= ICommunication_DataReceived;
            ICommGUI2RT.DataReceived   += ICommunication_DataReceived;
            ICommGUI2RT.IsDisConnected -= ICommunication_IsDisConnected;
            ICommGUI2RT.IsDisConnected += ICommunication_IsDisConnected;
            ICommGUI2RT.Listen("GUI2RT");

            ICommFA2RT = new Advanced.csCommunication();
            ICommFA2RT.DataReceived   -= ICommunication_DataReceived;
            ICommFA2RT.DataReceived   += ICommunication_DataReceived;
            ICommFA2RT.IsDisConnected -= ICommunication_IsDisConnected;
            ICommFA2RT.IsDisConnected += ICommunication_IsDisConnected;
            ICommFA2RT.Listen("FA2RT");

            //if (_main != null)
            //    _main.Iloggers.Where(r => r.logName == "GUI").FirstOrDefault().WriteLine(message);

            // User Account
            CustomPrincipal customPrincipal = new CustomPrincipal();

            AppDomain.CurrentDomain.SetThreadPrincipal(customPrincipal);
            AuthenticationViewModel viewModel = new AuthenticationViewModel(new AuthenticationService());

            mainlogin = new LogIn(viewModel);
            viewModel.Authenticated -= viewModel_Authenticated;
            viewModel.Authenticated += viewModel_Authenticated;
            Splasher.CloseSplash();
            mainlogin.ShowDialog();
        }