예제 #1
0
파일: MainPage.xaml.cs 프로젝트: porrey/i2c
        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            _dispatchTimer.Stop();
            _dispatchTimer.Tick -= DispatchTimer_Tick;

            if (_myDevice != null)
            {
                _myDevice.Dispose();
                _myDevice = null;
            }

            base.OnNavigatedFrom(e);
        }
예제 #2
0
파일: MainPage.xaml.cs 프로젝트: porrey/i2c
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            _myDevice = new MyDevice(0x26);

            if (await _myDevice.Initialize())
            {
                _dispatchTimer.Interval = TimeSpan.FromSeconds(5);
                _dispatchTimer.Tick    += DispatchTimer_Tick;
                _dispatchTimer.Start();
            }

            base.OnNavigatedTo(e);
        }