private void CarPreview_OnPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {
            var ev = Model.AcObject.SelectedEvent;
            if (ev == null) return;

            var control = new CarBlock {
                Car = ev.CarObject,
                SelectedSkin = ev.CarSkin,
                SelectSkin = SettingsHolder.Drive.KunosCareerUserSkin,
                OpenShowroom = true
            };

            var dialog = new ModernDialog {
                Content = control,
                Width = 640,
                Height = 720,
                MaxWidth = 640,
                MaxHeight = 720,
                SizeToContent = SizeToContent.Manual,
                Title = ev.CarObject.DisplayName
            };

            dialog.Buttons = new[] { dialog.OkButton, dialog.CancelButton };
            dialog.ShowDialog();

            if (dialog.IsResultOk && SettingsHolder.Drive.KunosCareerUserSkin) {
                ev.CarSkin = control.SelectedSkin;
            }
        }
예제 #2
0
        private void OpponentSkin_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {
            var entry = (sender as FrameworkElement)?.DataContext as RaceGridEntry;
            if (entry?.SpecialEntry != false) return;

            var dataGrid = (DetailsPopup.Content as FrameworkElement)?.FindVisualChild<DataGrid>();
            if (dataGrid != null) {
                dataGrid.SelectedItem = entry;
            }

            DetailsPopup.StaysOpen = true;

            var control = new CarBlock {
                Car = entry.Car,
                SelectedSkin = entry.CarSkin ?? entry.Car.SelectedSkin,
                SelectSkin = true,
                OpenShowroom = true
            };

            var dialog = new ModernDialog {
                Content = control,
                Width = 640,
                Height = 720,
                MaxWidth = 640,
                MaxHeight = 720,
                SizeToContent = SizeToContent.Manual,
                Title = entry.Car.DisplayName
            };

            dialog.Buttons = new[] { dialog.OkButton, dialog.CancelButton };
            dialog.ShowDialog();

            if (dialog.IsResultOk) {
                entry.CarSkin = control.SelectedSkin;
            }

            DetailsPopup.StaysOpen = false;
        }
예제 #3
0
파일: Rsr.xaml.cs 프로젝트: gro-ove/actools
        private void SkinLivery_OnPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {
            e.Handled = true;

            var control = new CarBlock {
                Car = Model.Car,
                SelectedSkin = Model.CarSkin,
                SelectSkin = SettingsHolder.Drive.KunosCareerUserSkin,
                OpenShowroom = true
            };

            var dialog = new ModernDialog {
                Content = control,
                Width = 640,
                Height = 720,
                MaxWidth = 640,
                MaxHeight = 720,
                SizeToContent = SizeToContent.Manual,
                Title = Model.Car.DisplayName
            };

            dialog.Buttons = new[] { dialog.OkButton, dialog.CancelButton };
            dialog.ShowDialog();

            if (dialog.IsResultOk) {
                Model.CarSkin = control.SelectedSkin;
            }
        }