Exemple #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.gridLoaiGroup = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.btnNuoc = ((ControlLibrary.POSButtonMenu)(target));
                return;

            case 3:
                this.btnThucAn = ((ControlLibrary.POSButtonMenu)(target));
                return;

            case 4:
                this.btnTatCa = ((ControlLibrary.POSButtonMenu)(target));
                return;

            case 5:
                this.gridItems = ((System.Windows.Controls.Grid)(target));
                return;

            case 6:
                this.gridGroup = ((System.Windows.Controls.Grid)(target));
                return;

            case 7:
                this.btnGroupBack = ((ControlLibrary.POSButtonMenu)(target));
                return;

            case 8:
                this.btnGroupNext = ((ControlLibrary.POSButtonMenu)(target));
                return;

            case 9:
                this.gridButton = ((System.Windows.Controls.Grid)(target));
                return;

            case 10:
                this.btnItemBack = ((ControlLibrary.POSButtonMenu)(target));
                return;

            case 11:
                this.btnItemNext = ((ControlLibrary.POSButtonMenu)(target));
                return;
            }
            this._contentLoaded = true;
        }
 public void SetButtonEmpty(POSButtonMenu btn)
 {
     btn.Visibility = System.Windows.Visibility.Hidden;
     btn.Content = "";
     btn.Image = null;
     btn.Background = System.Windows.Media.Brushes.Gray;
     btn.IsEnabled = false;
 }
 private void SetButtonKichThuocMon(POSButtonMenu btn, Data.BOMenuKichThuocMon item)
 {
     btn.Visibility = System.Windows.Visibility.Visible;
     btn.Tag = item;
     btn.IsEnabled = true;
     btn.Content = item.MenuKichThuocMon.TenLoaiBan;
     if (item.MenuMon.Hinh != null && item.MenuMon.Hinh.Length > 0)
     {
         btn.Image = Utilities.ImageHandler.BitmapImageFromByteArray(item.MenuMon.Hinh);
     }
     else
     {
         var uriSource = new Uri(@"/SystemImages;component/Images/NoImages.jpg", UriKind.Relative);
         btn.Image = new BitmapImage(uriSource);
     }
 }
 public void SetButtonNhom(POSButtonMenu btn, Data.BOMenuNhom item)
 {
     btn.Visibility = System.Windows.Visibility.Visible;
     btn.Tag = item;            
     btn.IsEnabled = true;
     btn.Content = item.MenuNhom.TenNgan;
     if (item.MenuNhom.Hinh != null && item.MenuNhom.Hinh.Length > 0)
     {
         btn.Image = Utilities.ImageHandler.BitmapImageFromByteArray(item.MenuNhom.Hinh);
     }
     else
     {
         if (mCaiDatThucDon.NhomImages != null && mCaiDatThucDon.NhomImages.Length > 0)
             btn.Image = Utilities.ImageHandler.BitmapImageFromByteArray(mCaiDatThucDon.NhomImages);
         else
         {
             var uriSource = new Uri(@"/SystemImages;component/Images/NoImages.jpg", UriKind.Relative);
             btn.Image = new BitmapImage(uriSource);
         }
     }
 }