public void UpdateTrading() { Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => { // TODO: As with updating the RecipeView, can we just update the trading view instead of recreating // it? screens[TRADING_VIEW] = new TradingView(); })); }
public TradingViewControl() { Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US"); InitializeComponent(); if (LicenseManager.UsageMode == LicenseUsageMode.Designtime) { try { var img = new Image(); var bitmap = new BitmapImage(); bitmap.BeginInit(); bitmap.UriSource = new Uri( "https://raw.githubusercontent.com/ExtremeDotneting/UndergroundIRO.TradingViewKit/master/data/splash.jpg", UriKind.Absolute ); bitmap.EndInit(); img.Stretch = Stretch.Fill; img.Source = bitmap; Content = img; } catch { } return; } var control = new CefSharpXWebViewControl(); BrowserPlace.Content = control; var xwv = new CefSharpXWebView(control); TradingView = new TradingView(xwv); Unloaded += delegate { TradingView.Dispose(); }; LoadingImageGrid.Visibility = UseSplashScreen ? Visibility.Visible : Visibility.Collapsed; TradingView.Refreshing += async(tv, refreshType) => { if (refreshType == ViewRefreshType.ReloadAllPage && UseSplashScreen) { await tv.XWV.ThreadSync.InvokeAsync(() => { LoadSplashScreenVisible = true; }); } }; TradingView.Refreshed += async(tv, refreshType) => { await tv.XWV.ThreadSync.InvokeAsync(() => { LoadSplashScreenVisible = false; }); }; }
private void execute(object obj) { var key = obj.ToString(); if (key == RECIPE_VIEW && screens[key] == null) { screens[key] = new RecipeView(); } if (key == TRADING_VIEW && screens[key] == null) { screens[key] = new TradingView(); } LoadView(screens[key]); }
public void UpdateTrading() { screens[TRADING_VIEW] = new TradingView(); }