Пример #1
0
        /// <summary>
        ///     Initializes the singleton application object.  This is the first line of authored code
        ///     executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            DependencyContainer.InitializeContainer(this);
            InitializeComponent();
            Suspending += OnSuspending;

            BatContext dbManager = DependencyContainer.Current.Resolve <BatContext>();

            dbManager.Database.Migrate();
        }
Пример #2
0
        public MainPageModel(NavigationEventArgs navigation, BatContext db, NavigationService navigationService, BatNodeLogReader logReader)
        {
            _db = db;
            _navigationService = navigationService;
            _logReader         = logReader;

            ImportFileCommand = new RelayCommand(async() => await ImportLogFile());
            EditCommand       = new RelayCommand(() =>
            {
                if (SelectedItem != null)
                {
                    _navigationService.EditLog(SelectedItem);
                }
            }, () => SelectedItem != null);
            DetailsCommand = new RelayCommand(() =>
            {
                if (SelectedItem != null)
                {
                    _navigationService.NavigateToLogDetails(SelectedItem);
                }
            }, () => SelectedItem != null);

            ManageDevicesCommand = new RelayCommand(() => _navigationService.NavigateToMangeDevices());
        }
Пример #3
0
 public EditLogViewModel(NavigationEventArgs navigation, BatContext db, NavigationHelper navigationHelper)
     : this((BatNodeLog)navigation.Parameter)
 {
     Db = db;
     _navigationHelper = navigationHelper;
 }
Пример #4
0
 public LogDetailsPageModel(NavigationEventArgs navigation, BatContext db, NavigationService navigationService)
     : this((BatNodeLog)navigation.Parameter)
 {
     _db = db;
     _navigationService = navigationService;
 }
 public PersonsRepository(BatContext context)
 {
     _context = context;
 }