1010using VisualHFT . Commons . Studies ;
1111using VisualHFT . View ;
1212using System . Collections . ObjectModel ;
13- using System . Windows . Controls ;
13+ using System . Windows . Controls ;
1414
1515namespace VisualHFT . ViewModel
1616{
@@ -52,9 +52,11 @@ public vmTile(IStudy study)
5252 IsGroup = false ;
5353
5454 _study = study ;
55+ _customControl = _study . GetCustomUI ( ) as UserControl ;
56+ IsUserControl = _customControl != null ;
5557 _tile_id = ( ( PluginManager . IPlugin ) _study ) . GetPluginUniqueID ( ) ;
5658 Title = _study . TileTitle ;
57- Tooltip = _study . TileToolTip ;
59+ Tooltip = _study . TileToolTip ;
5860
5961 _localModel . ValueFormatted = "." ;
6062 _localModel . Tooltip = "Waiting for data..." ;
@@ -63,13 +65,18 @@ public vmTile(IStudy study)
6365
6466 OpenSettingsCommand = new RelayCommand < vmTile > ( OpenSettings ) ;
6567 OpenChartCommand = new RelayCommand < vmTile > ( OpenChartClick ) ;
66-
67-
6868 uiUpdater = new UIUpdater ( uiUpdaterAction , UI_UPDATE_TIME_MS ) ;
6969
70+ if ( IsUserControl )
71+ {
72+ IsGroup = true ;
73+ ValueVisibility = Visibility . Hidden ;
74+ UCVisibility = Visibility . Visible ;
75+
76+ OpenSettingsCommand = new RelayCommand < vmTile > ( OpenSettings ) ;
77+ }
7078 RaisePropertyChanged ( nameof ( SelectedSymbol ) ) ;
7179 RaisePropertyChanged ( nameof ( SelectedProviderName ) ) ;
72-
7380 RaisePropertyChanged ( nameof ( IsGroup ) ) ;
7481 SettingButtonVisibility = Visibility . Visible ;
7582 ChartButtonVisibility = Visibility . Visible ;
@@ -194,7 +201,7 @@ public void UpdateAllUI()
194201 RaisePropertyChanged ( nameof ( SelectedProviderName ) ) ;
195202 }
196203
197- public ICommand OpenSettingsCommand { get ; set ; }
204+ public ICommand OpenSettingsCommand { get ; set ; }
198205 public ICommand OpenChartCommand { get ; private set ; }
199206
200207 public string Value { get => _value ; set => SetProperty ( ref _value , value ) ; }
@@ -300,7 +307,7 @@ private void OpenSettings(object obj)
300307 RaisePropertyChanged ( nameof ( SelectedProviderName ) ) ;
301308
302309 }
303-
310+
304311 protected virtual void Dispose ( bool disposing )
305312 {
306313 if ( ! _disposed )
0 commit comments