コード例 #1
0
        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);
        }
コード例 #2
0
        private ContextMenu getContextMenu()
        {
            ItemDisplayViewModel vm = this.DataContext as ItemDisplayViewModel;

            Item item = vm.Item;

            ContextMenu menu = new ContextMenu();

            menu.Background = Brushes.Black;

            if (!(item is Currency))
            {
                MenuItem setBuyout = new MenuItem();

                var buyoutControl = new SetBuyoutView();

                if (Settings.Buyouts.ContainsKey(item.UniqueIDHash))
                {
                    var price = Settings.Buyouts[item.UniqueIDHash].Split(' ');
                    buyoutControl.SetValue(price[0], CurrencyAbbreviationMap.Instance.FromAbbreviation(price[1]));
                }

                setBuyout.Header = buyoutControl;

                buyoutControl.SaveClicked   += new SetBuyoutView.BuyoutHandler(buyoutView_SaveClicked);
                buyoutControl.RemoveClicked += new SetBuyoutView.BuyoutHandler(buyoutControl_RemoveClicked);

                menu.Items.Add(setBuyout);
            }

            return(menu);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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;
        }
コード例 #5
0
        private ContextMenu getContextMenu()
        {
            ItemDisplayViewModel vm = this.DataContext as ItemDisplayViewModel;
            Item item = vm.Item;

            ContextMenu menu = new ContextMenu();
            menu.Background = Brushes.Black;

            menu.Resources = expressionDarkGrid;

            if (!(item is Currency))
            {
                MenuItem setBuyout = new MenuItem();

                var buyoutControl = new SetBuyoutView();

                if (Settings.Buyouts.ContainsKey(item.UniqueIDHash))
                {
                    var price = Settings.Buyouts[item.UniqueIDHash].Split(' ');
                    buyoutControl.SetValue(price[0], CurrencyAbbreviationMap.Instance.FromAbbreviation(price[1]));
                }

                setBuyout.Header = buyoutControl;
                buyoutControl.SaveClicked += new SetBuyoutView.BuyoutHandler(buyoutView_SaveClicked);
                buyoutControl.RemoveClicked += new SetBuyoutView.BuyoutHandler(buyoutControl_RemoveClicked);
                buyoutControl.SaveImageClicked += buyoutControl_SaveImageClicked;
                menu.Items.Add(setBuyout);
            }

            return menu;
        }