예제 #1
0
        private void DispatcherTimerTick(object sender, EventArgs e)
        {
            var dt = DateTime.Now;

            _countTick++;

            ldt.Content = $"{dt} ({Sec - _countTick}) ";

            if (!Config.FromLoadSyncAll)
            {
                if (_countTick == Sec)
                {
                    _countTick = 0;

                    foreach (var bs in ClassEtcFun.FindVisualChildren <Button>(this).Where(bs => (string)bs.ToolTip == "UpdateDB"))
                    {
                        if (_bUpdText == string.Empty)
                        {
                            _bUpdText = bs.Content.ToString();
                        }
                        bs.Content = $"{_bUpdText} ({RepositoryProduct.GetAbCountFromDb()})";
                    }

                    ldtc.Content = "BD a été MàJ " + dt.ToLongTimeString();
                }
            }
            else
            {
                ldtc.Content = "Происходит фоновая синхронизация... работайте ....";
            }

            CommandManager.InvalidateRequerySuggested();
        }