public MainWindow(AFClientConfig config) { InitializeComponent(); DataContext = this; _mainThread = new AFClientMainThread(this, config); _mainThread.Start(); }
private void AFClient_Startup(object sender, StartupEventArgs e) { AFClientConfig clientConfig = null; try { using (var reader = new StreamReader(CONFIG_FILE_LOCATION)) { string str = reader.ReadToEnd(); var deserializer = new DeserializerBuilder().WithNamingConvention(PascalCaseNamingConvention.Instance).Build(); clientConfig = deserializer.Deserialize <AFClientConfig>(str); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); Environment.Exit(-2); } MainWindow wnd = new MainWindow(clientConfig); wnd.Show(); }
/// <summary> Constructor </summary> /// <param name="wnd">MainWindow handle</param> /// <param name="config">Client config</param> public AFClientMainThread(MainWindow wnd, AFClientConfig config) : base(1000) { _mainWindow = wnd; _clientConfig = config; }