Beispiel #1
0
        public void SetCarObjectMenu(ContextMenu menu, CarObject car, CarSkinObject skin)
        {
            menu.AddItem("Manage setups", () => CarSetupsListPage.Open(car))
            .AddItem("Manage skins", () => CarSkinsListPage.Open(car))
            .AddSeparator();
            CarBlock.OnShowroomContextMenu(menu, car, skin);

            menu.AddSeparator();

            var ratingBar = new RatingBar {
                Rating = car.Rating ?? 0
            };

            ratingBar.SetBinding(RatingBar.RatingProperty, new Binding("Rating")
            {
                Source = car
            });
            menu.AddItem(new MenuItem {
                StaysOpenOnClick = true,
                Header           = new DockPanel {
                    Margin   = new Thickness(0d, 0d, -40d, 0d),
                    Children =
                    {
                        new TextBlock       {
                            Text = "Rating:", Width = 80
                        },
                        ratingBar,
                        new FavouriteButton {
                            IsChecked = car.IsFavourite
                        }
                    }
                }
            });
            menu.AddItem(new MenuItem {
                StaysOpenOnClick = true,
                Header           = new DockPanel {
                    Margin   = new Thickness(0d, 0d, -40d, 0d),
                    Children =
                    {
                        new TextBlock  {
                            Text = "Notes:", Width = 80
                        },
                        new NotesBlock {
                            AcObject = car
                        }
                    }
                }
            });

            menu.AddSeparator();

            if (!QuickDrive.IsActive())
            {
                menu.AddItem("Open car in Quick Drive", () => QuickDrive.Show(car, skin?.Id));
            }

            menu.AddItem("Open car in Content tab", () => CarsListPage.Show(car, skin?.Id))
            .AddItem(AppStrings.Toolbar_Folder, car.ViewInExplorer);
        }
        public void SetCarObjectMenu(ContextMenu menu, CarObject car, CarSkinObject skin)
        {
            menu.AddItem("Manage setups", () => CarSetupsListPage.Open(car))
            .AddItem("Manage skins", () => CarSkinsListPage.Open(car))
            .AddSeparator();
            CarBlock.OnShowroomContextMenu(menu, car, skin);

            menu.AddSeparator();

            if (!QuickDrive.IsActive())
            {
                menu.AddItem("Open car in Quick Drive", () => QuickDrive.Show(car, skin?.Id));
            }

            menu.AddItem("Open car in Content tab", () => CarsListPage.Show(car, skin?.Id))
            .AddItem(AppStrings.Toolbar_Folder, car.ViewInExplorer);
        }