public App() { string logsFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase); Uri uri = new Uri(logsFolder); logsFolder = uri.LocalPath; logsFolder = Path.Combine(logsFolder, "logs"); Log.SetLogFileDirectory(logsFolder); Log.SetLogFilename("Tess4Windows.txt"); Log.SetLevel(Log.LEVEL.INFO); Log.Info("Tess4Windows - Start"); DeleteOldLogs(logsFolder); this.DispatcherUnhandledException += HandleUnhandledExceptions; BindingExceptionThrower.Attach(); try { tessBackground = aBasics.WpfBasics.Images.ImageSourceFromFile("Images\\tess_win_bg.jpg"); } catch (Exception ex) { Log.Error("Load tessBackground", ex); } TessControlManager tcm = new TessControlManager(); TessControlManager.Instance = tcm; }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); if (Debugger.IsAttached) { BindingExceptionThrower.Attach(); } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); // Start listening for WPF binding error. // After that line, a BindingException will be thrown each time // a binding error occurs BindingExceptionThrower.Attach(); }
public MainWindow() { //Silence freezable trace warnings since they don't seem to represent an actual problem PresentationTraceSources.FreezableSource.Switch.Level = SourceLevels.Error; BindingExceptionThrower.Attach(); InitializeComponent(); // Persist window position and size when opening and closing the application SourceInitialized += (sender, args) => Settings.StateTracker.Configure(this).IdentifyAs("WindowPosition").Apply(); var mainWindowViewModel = (MainWindowViewModel)DataContext; var mappingsCollectionView = (ListCollectionView)CollectionViewSource.GetDefaultView(mainWindowViewModel.DisplayedMappings); mappingsCollectionView.SortDescriptions.Add(new SortDescription(nameof(DirectoryMapping.StringRepresentation), ListSortDirection.Ascending)); ContentRendered += (sender, args) => { if (!Directory.Exists(Settings.AppDataDirectoryPath)) { mainWindowViewModel.NewUserSetup(); } }; }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); BindingExceptionThrower.Attach(); }
private void Application_Startup(object sender, StartupEventArgs e) { BindingExceptionThrower.Attach(); }