/// <summary>
        ///
        /// </summary>
        /// <param name="parameter"></param>
        public void EditConfiguration(object parameter)
        {
            var crypto = parameter as Crypto;
            var header = string.Format("{0} ({1})", crypto.CryptoName, crypto.CryptoSymbol);
            var tab    = InstanceStore.TabStore.GetTabByHeader(header);

            if (tab == null)
            {
                var configuration        = ConfigurationRepositoryHelper.GetConfigurationByCryptoId(crypto.CryptoId);
                var defaultConfiguration = ConfigurationRepositoryHelper.GetDefaultConfigurationByCryptoId(crypto.CryptoId);
                var viewModel            = new ConfigurationTabViewModel
                {
                    Header = header,
                    SelectedConfiguration = configuration,
                    DefaultConfiguration  = defaultConfiguration,
                };
                InstanceStore.TabStore.CreateTab(viewModel);
                viewModel.SelectedConfiguration.CacheObject();
                viewModel.SelectedConfiguration.ResetModified();
            }
            else
            {
                SendMessage(new MainViewModelMessage()
                {
                    Purpose = MessagePurpose.SET_SELECTED_TAB, Payload = tab
                });
            }
        }
Example #2
0
 public TabsViewModel(ShoutoutTabViewModel shoutouts,
                      ResponseTabViewModel responses,
                      ConfigurationTabViewModel configuration,
                      TextCommandsTabViewModel textCommands)
 {
     this.Shoutouts     = shoutouts;
     this.Responses     = responses;
     this.Configuration = configuration;
     this.TextCommands  = textCommands;
 }