private DelegateCommand _reloadCommand;
private DelegateCommand _autoReloadCommand;
private DelegateCommand _saveCommand;
- private DelegateCommand _popupCommand;
+ private DelegateCommand _saveFrequencyCommand;
+ private DelegateCommand _popupCommand;
private System.Timers.Timer _timer;
private bool _autoReload;
private ltepopup _ltepopup;
private ComboBoxItem _selectedItem;
+ private ComboBoxItem _selectedFrequency;
+ private Visibility _frequencySettingsVisibility = Visibility.Hidden;
- private string _imei;
+ private string _imei;
private string _imsi;
private string _device_status;
private string _card_status;
set { SetProperty(ref _saveCommand, value); }
}
- public DelegateCommand PopupCommand
+
+ public DelegateCommand SaveFrequencyCommand
+ {
+ get { return _saveFrequencyCommand; }
+ set { SetProperty(ref _saveFrequencyCommand, value); }
+ }
+ public DelegateCommand PopupCommand
{
get { return _popupCommand; }
set { SetProperty(ref _popupCommand, value); }
{
get { return _selectedItem; }
set { SetProperty(ref _selectedItem, value); }
- }
+ }
+
+ public ComboBoxItem SelectedFrequency
+ {
+ get { return _selectedFrequency; }
+ set { SetProperty(ref _selectedFrequency, value); }
+ }
- private void OnReloadCommandExecute()
+ public Visibility FrequencySettingsVisibility
+ {
+ get { return _frequencySettingsVisibility; }
+ set { SetProperty(ref _frequencySettingsVisibility, value); }
+ }
+
+ private void OnReloadCommandExecute()
{
new Thread(() => { SpeedportHybrid.initLTE(); }).Start();
}
OnReloadCommandExecute();
}
+ private void OnSaveFrequencyCommandExecute()
+ {
+ if (Object.Equals(SelectedFrequency, null).Equals(true))
+ {
+ return;
+ }
+
+ switch (SelectedFrequency.Name)
+ {
+ case "B1":
+ util.setLteFrequency(LTEBand.LTE800);
+ break;
+
+ case "B2":
+ util.setLteFrequency(LTEBand.LTE1800);
+ break;
+
+ case "B3":
+ util.setLteFrequency(LTEBand.LTE2600);
+ break;
+
+ case "B4":
+ util.setLteFrequency(LTEBand.LTE800 | LTEBand.LTE1800 | LTEBand.LTE2600);
+ break;
+
+ case "B5":
+ util.setLteFrequency(LTEBand.LTE800 | LTEBand.LTE1800);
+ break;
+
+ case "B6":
+ util.setLteFrequency(LTEBand.LTE800 | LTEBand.LTE2600);
+ break;
+
+ case "B7":
+ util.setLteFrequency(LTEBand.LTE1800 | LTEBand.LTE2600);
+ break;
+ }
+ }
+
private void OnPopupCommandExecute()
{
if (Object.Equals(_ltepopup, null))
ReloadCommand = new DelegateCommand(new Action(OnReloadCommandExecute));
AutoReloadCommand = new DelegateCommand(new Action(OnAutoReloadCommandExecute));
SaveCommand = new DelegateCommand(new Action(OnSaveCommandExecute));
- PopupCommand = new DelegateCommand(new Action(OnPopupCommandExecute));
+ SaveFrequencyCommand = new DelegateCommand(new Action(OnSaveFrequencyCommandExecute));
+ PopupCommand = new DelegateCommand(new Action(OnPopupCommandExecute));
+
+ if (util.checkLteModul().Equals(true))
+ {
+ FrequencySettingsVisibility = Visibility.Visible;
+ }
}
}
}