public AcSettingsControls_Wheel_ForceFeedback() { try { _wrapper = LutLibraryWrapper.Initialize(); } catch (Exception) { // ignored } var mainWindow = Application.Current.MainWindow; if (mainWindow != null) { mainWindow.Drop += OnMainWindowDrop; } DataContext = new ViewModel(_wrapper); InitializeComponent(); if (_wrapper == null) { ImportCsvButton.Visibility = Visibility.Collapsed; } else { LutLibraryMessage.Visibility = Visibility.Collapsed; } this.OnActualUnload(() => { if (mainWindow != null) { mainWindow.Drop -= OnMainWindowDrop; } }); this.AddWidthCondition(900).Add(v => Grid.Columns = v ? 2 : 1); }
public AcSettingsControls_Wheel_ForceFeedback() { try { _wrapper = LutLibraryWrapper.Initialize(); } catch (Exception) { // ignored } var mainWindow = Application.Current.MainWindow; if (mainWindow != null) { mainWindow.Drop += OnMainWindowDrop; } DataContext = new ViewModel(_wrapper); InitializeComponent(); if (_wrapper == null) { ImportCsvButton.Visibility = Visibility.Collapsed; } else { LutLibraryMessage.Visibility = Visibility.Collapsed; } this.OnActualUnload(() => { Logging.Here(); DisposeHelper.Dispose(ref _wrapper); if (mainWindow != null) { mainWindow.Drop -= OnMainWindowDrop; } }); }