private ContextMenu getContextMenu() { ItemDisplayViewModel vm = this.DataContext as ItemDisplayViewModel; Item item = vm.Item; ContextMenu menu = new ContextMenu(); menu.Background = Brushes.Black; menu.Resources = expressionDarkGrid; MenuItem setBuyout = new MenuItem(); setBuyout.StaysOpenOnClick = true; var buyoutControl = new SetBuyoutView(); if (Settings.Buyouts.ContainsKey(item.UniqueIDHash)) { buyoutControl.SetBuyoutInfo(Settings.Buyouts[item.UniqueIDHash]); } setBuyout.Header = buyoutControl; buyoutControl.Update += buyoutControl_Update; buyoutControl.SaveImageClicked += buyoutControl_SaveImageClicked; menu.Items.Add(setBuyout); return(menu); }
private ContextMenu getContextMenu() { var vm = DataContext as ItemDisplayViewModel; var item = vm.Item; var menu = new ContextMenu(); menu.Background = Brushes.Black; menu.Resources = Resources["ExpressionDarkGrid"] as ResourceDictionary; var setBuyout = new MenuItem(); setBuyout.StaysOpenOnClick = true; var buyoutControl = new SetBuyoutView(); if (Settings.Buyouts.ContainsKey(item.Id)) { buyoutControl.SetBuyoutInfo(Settings.Buyouts[item.Id]); } setBuyout.Header = buyoutControl; buyoutControl.Update += buyoutControl_Update; buyoutControl.SaveImageClicked += buyoutControl_SaveImageClicked; menu.Items.Add(setBuyout); return(menu); }
private ContextMenu getContextMenu() { ItemDisplayViewModel vm = this.DataContext as ItemDisplayViewModel; Item item = vm.Item; ContextMenu menu = new ContextMenu(); menu.Background = Brushes.Black; menu.Resources = expressionDarkGrid; MenuItem setBuyout = new MenuItem(); var buyoutControl = new SetBuyoutView(); if (Settings.Buyouts.ContainsKey(item.UniqueIDHash)) buyoutControl.SetBuyoutInfo(Settings.Buyouts[item.UniqueIDHash]); setBuyout.Header = buyoutControl; buyoutControl.Update += buyoutControl_Update; buyoutControl.SaveImageClicked += buyoutControl_SaveImageClicked; menu.Items.Add(setBuyout); return menu; }