public SelectCarDialog(CarObject car) {
_selectedCar = new DelayedPropertyWrapper<CarObject>(SelectedCarChanged);
SelectedCar = car;
_instance = new WeakReference<SelectCarDialog>(this);
DataContext = this;
InputBindings.AddRange(new[] {
new InputBinding(OpenInShowroomCommand, new KeyGesture(Key.H, ModifierKeys.Control)),
new InputBinding(OpenInShowroomOptionsCommand, new KeyGesture(Key.H, ModifierKeys.Control | ModifierKeys.Shift)),
new InputBinding(OpenInCustomShowroomCommand, new KeyGesture(Key.H, ModifierKeys.Alt)),
new InputBinding(OpenInCustomShowroomCommand, new KeyGesture(Key.H, ModifierKeys.Alt | ModifierKeys.Control))
});
InitializeComponent();
CarBlock.BrandArea.PreviewMouseLeftButtonDown += (sender, args) => {
Tabs.SelectedSource = BrandUri(SelectedCar.Brand);
};
CarBlock.ClassArea.PreviewMouseLeftButtonDown += (sender, args) => {
Tabs.SelectedSource = ClassUri(SelectedCar.CarClass);
};
CarBlock.YearArea.PreviewMouseLeftButtonDown += (sender, args) => {
Tabs.SelectedSource = YearUri(SelectedCar.Year);
};
CarBlock.CountryArea.PreviewMouseLeftButtonDown += (sender, args) => {
Tabs.SelectedSource = CountryUri(SelectedCar.Country);
};
Buttons = new [] { OkButton, CancelButton };
}