Example #1
0
        public TranslatorTools()
        {
            DataContext = _vm;
            AvaloniaXamlLoader.Load(this);
            this.AttachDevTools();

            _ignoreConnLoss = this.FindControl <CheckBox>("IgnoreConnLoss");
            _dummyDevices   = this.FindControl <CheckBox>("DummyDevices");
            _pages          = this.FindControl <ComboBox>("Pages");
            _locales        = this.FindControl <ComboBox>("Locales");
            _xamlPath       = this.FindControl <TextBox>("XamlPath");

            _locales.SelectedItem     = SettingsProvider.Instance.Locale;
            _xamlPath.Text            = Loc.GetTranslatorModeFile();
            _ignoreConnLoss.IsChecked = BluetoothImpl.Instance.SuppressDisconnectionEvents;
            _dummyDevices.IsChecked   = MainWindow.Instance.DeviceSelectionPage.EnableDummyDevices;

            Loc.ErrorDetected += (title, content) =>
            {
                new MessageBox
                {
                    Title       = title,
                    Description = content
                }.ShowDialog(this);
            };
        }