public MainWindow()
        {
            Logger.SetLoggingLevel();
            Logger.LogDirectory(DirectoryStructure.CLIENT_LOGS_LOCATION);

            TradeSharpLicenseManager.GetLicense();

            InitializeComponent();

            // Save UI thread reference
            _currentDispatcher = Dispatcher.CurrentDispatcher;

            DataContext = new BaseViewModel();
            AppDomain.CurrentDomain.UnhandledException +=
                new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            if (!TradeSharpLicenseManager.GetLicense().IsActive)
            {
                WPFMessageBox.Show("The application license has expired.\n\nPlease contact TradeSharp support at: [email protected]", "TRADESHARP",
                                   MessageBoxButton.OK, MessageBoxImage.Error);
            }

            // Subscribe Events
            EventSystem.Subscribe <UiElement>(UpdateRelayCommands);
        }
 private bool AddProviderCanExecute()
 {
     if (TradeSharpLicenseManager.GetLicense().IsDemo)
     {
         return(false);
     }
     return(true);
 }
        private void AboutButton_Click(object sender, RoutedEventArgs e)
        {
            StringBuilder aboutMessage = new StringBuilder();

            aboutMessage.AppendLine("TradeSharp is a C# based data feed & broker neutral Algorithmic Trading Platform that lets trading firms or individuals automate any rules based trading strategies in stocks, forex and ETFs. TradeSharp has been developed and is being maintained by Aurora Solutions.");
            aboutMessage.AppendLine("\n\n");
            aboutMessage.AppendLine("This product is licensed to: " + TradeSharpLicenseManager.GetLicense().ClientDetails);
            aboutMessage.AppendLine("The licensed will expire on: " + TradeSharpLicenseManager.GetLicense().ExpirationDate.Date.ToString("D"));
            aboutMessage.AppendLine("\n");
            aboutMessage.Append("For queries contact: [email protected]");

            var metroDialog = new MetroDialogSettings();

            metroDialog.ColorScheme = MetroDialogColorScheme.Theme;

            this.ShowMessageAsync("TRADESHARP", aboutMessage.ToString(), MessageDialogStyle.Affirmative, metroDialog);
        }