Пример #1
0
        void ItemDisplay_Loaded(object sender, RoutedEventArgs e)
        {
            ItemDisplayViewModel vm = this.DataContext as ItemDisplayViewModel;

            if (vm != null)
            {
                Image i = vm.getImage();
                itemImage = i;

                if (i != null)
                {
                    this.MainGrid.Children.Add(i);

                    if (vm.HasSocket)
                    {
                        BindSocketPopup(vm);
                    }

                    this.Height = i.Height;
                    this.Width  = i.Width;
                }
            }
            this.Loaded -= new RoutedEventHandler(ItemDisplay_Loaded);

            resyncText();
        }
Пример #2
0
        void ItemDisplay_Loaded(object sender, RoutedEventArgs e)
        {
            ItemDisplayViewModel vm = this.DataContext as ItemDisplayViewModel;
            Image i = vm.getImage();

            UIElement socket = vm.getSocket();

            this.MainGrid.Children.Add(i);

            if (socket != null)
            {
                doSocketOnHover(socket, i);
            }

            if (EnableBuyOuts == bool.TrueString)
            {
                i.ContextMenu = getContextMenu();
            }
            this.Height = i.Height;
            this.Width  = i.Width;

            this.Loaded -= new RoutedEventHandler(ItemDisplay_Loaded);
            if (EnableBuyOuts == bool.TrueString)
            {
                resyncText();
            }
        }