private void UserControl_Unloaded(object sender, RoutedEventArgs e)
 {
     MainGrid.MouseMove -= MainGrid_MouseMove;
     Infos?.Clear();
     Infos  = null;
     Imager = null;
 }
Exemple #2
0
 public void InitializeImages(List <ImageInfo> imageInfos, PadControlImager imager, MapTo mappedTo)
 {
     Infos    = imageInfos;
     Imager   = imager;
     MappedTo = mappedTo;
     foreach (var ii in imageInfos)
     {
         var nameCode = GetNameCode(ii.Code);
         var button   = FindName(nameCode.ToString()) as Button;
         ii.ButtonControl = button;
         SetImage(ii.Code, NavImageType.Normal, false);
     }
     SetHelpText();
 }
Exemple #3
0
 private void UserControl_Unloaded(object sender, System.Windows.RoutedEventArgs e)
 {
     // Cleanup references which prevents disposal.
     Global.UpdateControlFromStates             -= Global_UpdateControlFromStates;
     SettingsManager.Current.SettingChanged     -= Current_SettingChanged;
     CurrentPadSetting.PropertyChanged          -= CurrentPadSetting_PropertyChanged;
     PadListPanel.MainDataGrid.SelectionChanged -= MainDataGrid_SelectionChanged;
     XboxImage.StartRecording = null;
     XboxImage.StopRecording  = null;
     RecordAllMaps.Clear();
     imageInfos.Clear();
     _Imager?.Dispose();
     _Imager             = null;
     _CurrentUserSetting = null;
     _CurrentUserDevice  = null;
 }
Exemple #4
0
 public void InitControls(MapTo mappedTo)
 {
     if (ControlsHelper.IsDesignMode(this))
     {
         return;
     }
     // Add controls which must be notified on setting selection change.
     Global.UpdateControlFromStates += Global_UpdateControlFromStates;
     // Hide for this version.
     //PadItemPanel.PadTabControl.Items.Remove(PadItemPanel.XInputTabPage);
     //PadItemPanel.XInputTabPage.Content = null;
     //PadTabControl.TabPages.Remove(MacrosTabPage);
     RemapName                  = GeneralPanel.RemapAllButton.Content as string;
     MappedTo                   = mappedTo;
     _Imager                    = new PadControlImager();
     _Imager.Top                = XboxImage.TopPictureImage;
     _Imager.Front              = XboxImage.FrontPictureImage;
     _Imager.LeftThumbStatus    = XboxImage.LeftThumbContentControl;
     _Imager.RightThumbStatus   = XboxImage.RightThumbContentControl;
     _Imager.LeftTriggerStatus  = XboxImage.LeftTriggerContentControl;
     _Imager.RightTriggerStatus = XboxImage.RightTriggerContentControl;
     _Imager.ImageControl       = XboxImage;
     XboxImage.InitializeImages(imageInfos, _Imager, mappedTo);
     XboxImage.StartRecording = StartRecording;
     XboxImage.StopRecording  = StopRecording;
     // Axis to Button DeadZones
     ButtonsPanel.AxisToButtonADeadZonePanel.MonitorComboBoxWpf          = GeneralPanel.ButtonATextBox;
     ButtonsPanel.AxisToButtonBDeadZonePanel.MonitorComboBoxWpf          = GeneralPanel.ButtonBTextBox;
     ButtonsPanel.AxisToButtonXDeadZonePanel.MonitorComboBoxWpf          = GeneralPanel.ButtonXTextBox;
     ButtonsPanel.AxisToButtonYDeadZonePanel.MonitorComboBoxWpf          = GeneralPanel.ButtonYTextBox;
     ButtonsPanel.AxisToButtonStartDeadZonePanel.MonitorComboBoxWpf      = GeneralPanel.ButtonStartTextBox;
     ButtonsPanel.AxisToButtonBackDeadZonePanel.MonitorComboBoxWpf       = GeneralPanel.ButtonBackTextBox;
     ButtonsPanel.AxisToLeftShoulderDeadZonePanel.MonitorComboBoxWpf     = GeneralPanel.LeftShoulderTextBox;
     ButtonsPanel.AxisToLeftThumbButtonDeadZonePanel.MonitorComboBoxWpf  = GeneralPanel.LeftThumbButtonTextBox;
     ButtonsPanel.AxisToRightShoulderDeadZonePanel.MonitorComboBoxWpf    = GeneralPanel.RightShoulderTextBox;
     ButtonsPanel.AxisToRightThumbButtonDeadZonePanel.MonitorComboBoxWpf = GeneralPanel.RightThumbButtonTextBox;
     ButtonsPanel.AxisToDPadDownDeadZonePanel.MonitorComboBoxWpf         = GeneralPanel.DPadDownTextBox;
     ButtonsPanel.AxisToDPadLeftDeadZonePanel.MonitorComboBoxWpf         = GeneralPanel.DPadLeftTextBox;
     ButtonsPanel.AxisToDPadRightDeadZonePanel.MonitorComboBoxWpf        = GeneralPanel.DPadRightTextBox;
     ButtonsPanel.AxisToDPadUpDeadZonePanel.MonitorComboBoxWpf           = GeneralPanel.DPadUpTextBox;
     // Monitor setting changes.
     SettingsManager.Current.SettingChanged += Current_SettingChanged;
     PadListPanel.SetBinding(MappedTo);
     PadListPanel.MainDataGrid.SelectionChanged += MainDataGrid_SelectionChanged;
 }