private async void ListAvailablePorts()
        {
            try
            {
                m_listOfDevices.Clear();
                string aqs = SerialDevice.GetDeviceSelector();
                var    dis = await DeviceInformation.FindAllAsync(aqs);

                status.Text = "Select a device and connect";

                for (int i = 0; i < dis.Count; i++)
                {
                    SerDevice serSev = new SerDevice(dis[i].Id);
                    m_listOfDevices.Add(serSev);
                }


                //    OpenDevice.IsEnabled = (m_listOfDevices.Count > 0);

                //    closeDevice.IsEnabled = false;
                ConnectDevices.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                status.Text = ex.Message;
            }
        }
        async private void Connector_SEN0188_startStreaming(object sender, SerDevice args)
        {
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
            {
                m_Environment.SensorConnecorInitialized = true;

                m_Environment.SensorInitialized = false;
            });
        }
        //  System.Collections.Generic.IList<byte> m_SensorId;



        public FingerSensorManager()
        {
            InitializeComponent();
            m_Environment               = null;
            m_DataSets                  = null;
            m_SEN0188SQLite             = null;
            m_Sensoroutputconfigoptions = null;
            m_Sensorinputconfigoptions  = null;
            m_serDev          = null;
            m_FilledFingerLib = new ObservableCollection <uint>();
        }
        private void comPortInput_Click(object sender, RoutedEventArgs e)
        {
            var       selection = ConnectDevices.SelectedItem;
            SerDevice serDev    = selection as SerDevice;

            if (selection == null)
            {
                status.Text = "Select a device and connect";
                return;
            }
            this.m_Environment.SerDev.Id = serDev.Id;
            StartConnector();
        }
        public StationEnvironment()
        {
            m_HostName             = "localhost";
            m_Port                 = 3005;
            m_serDev               = new SerDevice("COM1");
            m_Connector_SEN0188    = new Connector_SEN0188();
            m_SEN0188SQLite        = new SEN0188SQLite();
            m_FingertEventDatabase = new FingertEventDatabase();
            m_SensorOutPutServiceConnectorConfig = new PropertySet();
            m_SensorInputServiceConnectorConfig  = new PropertySet();

            m_GPIOOutPutServiceConnectorConfig = new PropertySet();
            m_GPIOInputServiceConnectorConfig  = new PropertySet();



            m_GPIOInputServiceConnectorConfig.Add("HostName", PropertyValue.CreateString("WilliRaspiPlus"));
            m_GPIOInputServiceConnectorConfig.Add("Port", PropertyValue.CreateInt32(3005));
            m_GPIOInputServiceConnectorConfig.Add("UpdateState", PropertyValue.CreateInt32(0));
            m_GPIOInOutBanks = null;

            m_ConnectorSEN0188Enable = false;

            m_GPIOEnvironmentConnectors = new GPIOEnvironmentConnectors();


            m_ConfigProcessItems  = new ConfigProcessItems(m_GPIOEnvironmentConnectors);
            m_ProcessorGPIOEvents = new ProcessorGPIOEvents(this);

            m_SensorConnecorInitialized = false;
            m_GPIOConnecorInitialized   = false;
            m_SensorInitialized         = false;
            m_IsLoggedIn   = false;
            m_isAuthorized = false;
            m_user         = null;
            m_PeriodicTimerDelFingerEvents = null;
            m_EventHistoryinDays           = 14; // 14 Tage
        }
        protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            if (e.Parameter is FingerSensorsApp.App)
            {
                FingerSensorsApp.App AppEnvironment = e.Parameter as FingerSensorsApp.App;


                if (AppEnvironment != null)
                {
                    m_Environment               = AppEnvironment.Environment;
                    m_DataSets                  = m_Environment.SEN0188SQLite.DataSets;
                    m_SEN0188SQLite             = m_Environment.SEN0188SQLite;
                    m_Connector_SEN0188         = m_Environment.SensorConnector;
                    m_Sensoroutputconfigoptions = m_Environment.SensorOutPutServiceConnectorConfig;
                    m_Sensorinputconfigoptions  = m_Environment.SensorInputServiceConnectorConfig;
                    m_SEN0188SQLite.GetDataSets();

                    m_serDev           = m_Environment.SerDev;
                    SensorIDValue.Text = "not set";
                    m_Connector_SEN0188.NotifyChangeState += Connector_SEN0188_NotifyChangeState;
                }
            }
            base.OnNavigatedTo(e);
        }