Пример #1
0
        private static void CreateRadarWindow()
        {
            if (_radarWindow == null)
            {
                Logger.Log("Loading RadarUI");
                var radarXamlPath = Path.Combine(FileManager.PluginPath, "UI", "RadarUI.xaml");
                _radarWindow = new ThreadedWindow(radarXamlPath, _dataModel, "RadarUI", 600, 600);

                _dataModel.PropertyChanged += (sender, args) =>
                {
                    if (args.PropertyName == "IsRadarWindowVisible")
                    {
                        if (_dataModel.IsRadarWindowVisible)
                        {
                            _radarWindow.Show();
                        }
                        else
                        {
                            _radarWindow.Hide();
                        }
                    }
                };

                _radarWindow.OnHidden += () =>
                {
                    _dataModel.IsRadarWindowVisible = false;
                };
            }
        }
Пример #2
0
        public static void CreateWindow()
        {
            if (_dataModel == null)
            {
                _dataModel = new CacheUIDataModel();
                _dataModel.PropertyChanged          += DataModelOnPropertyChanged;
                Configuration.Events.OnCacheUpdated += Update;
            }

            if (_cacheWindow == null)
            {
                Logger.Log("Loading CacheUI");
                var cacheXamlPath = Path.Combine(FileManager.PluginPath, "UI", "CacheUI.xaml");
                _cacheWindow = new ThreadedWindow(cacheXamlPath, _dataModel, "CacheUI", 750, 1200);
            }

            _cacheWindow.Show();

            CreateRadarWindow();

            _internalTimer          = new DispatcherTimer();
            _internalTimer.Tick    += InternalTimerTick;
            _internalTimer.Interval = new TimeSpan(0, 0, 0, 0, 50);
            _internalTimer.Start();
        }
Пример #3
0
        private static void CreateRadarWindow()
        {
            if (_radarWindow == null)
            {
                Logger.Log("Loading RadarUI");
                var radarXamlPath = Path.Combine(FileManager.PluginPath, "UI", "RadarUI.xaml");
                _radarWindow = new ThreadedWindow(radarXamlPath, _dataModel, "RadarUI", 600, 600);

                _dataModel.PropertyChanged += (sender, args) =>
                {
                    if (args.PropertyName == "IsRadarWindowVisible")
                    {
                        if (_dataModel.IsRadarWindowVisible)
                        {
                            _radarWindow.Show();
                        }
                        else
                        {
                            _radarWindow.Hide();
                        }
                    }
                };

                _radarWindow.OnHidden += () =>
                {
                    _dataModel.IsRadarWindowVisible = false;
                };
            }
        }