public ProgramControl(ProgramSet prog, CategoryModel Categories) { InitializeComponent(); chkNotify.Content = Translate.fmt("lbl_notify"); btnAdd.Content = Translate.fmt("lbl_add"); btnSplit.Content = Translate.fmt("lbl_split"); btnRemove.Content = Translate.fmt("lbl_remove"); progGrid.Columns[1].Header = Translate.fmt("lbl_name"); progGrid.Columns[2].Header = Translate.fmt("lbl_program"); SuspendChange++; progArea.Visibility = Visibility.Collapsed; CatModel = Categories; //category.ItemsSource = CatModel.Categorys; category.ItemsSource = CatModel.GetCategorys(); //mBorderBrush = name.BorderBrush; //name.BorderBrush = Brushes.Transparent; cmbAccess.Items.Add(new ComboBoxItem() { Content = Translate.fmt("acl_none"), Tag = ProgramSet.Config.AccessLevels.Unconfigured }); cmbAccess.Items.Add(new ComboBoxItem() { Content = Translate.fmt("acl_allow"), Tag = ProgramSet.Config.AccessLevels.FullAccess }); cmbAccess.Items.Add(new ComboBoxItem() { Content = Translate.fmt("acl_edit"), Tag = ProgramSet.Config.AccessLevels.CustomConfig }); cmbAccess.Items.Add(new ComboBoxItem() { Content = Translate.fmt("acl_lan"), Tag = ProgramSet.Config.AccessLevels.LocalOnly }); cmbAccess.Items.Add(new ComboBoxItem() { Content = Translate.fmt("acl_block"), Tag = ProgramSet.Config.AccessLevels.BlockAccess }); foreach (ComboBoxItem item in cmbAccess.Items) { item.Background = GetAccessColor((ProgramSet.Config.AccessLevels)item.Tag); } SuspendChange--; progSet = prog; DoUpdate(); ProgramID id = prog.Programs.First().Key; if (id.Type == ProgramID.Types.Global || id.Type == ProgramID.Types.System) { btnIDs.IsEnabled = false; //btnCustimize.Visibility = Visibility.Hidden; cmbAccess.Visibility = Visibility.Hidden; //category.Visibility = Visibility.Hidden; } if (id.Type == ProgramID.Types.Global) { chkNotify.Visibility = Visibility.Hidden; } rect.MouseDown += new MouseButtonEventHandler(rect_Click); //name.MouseDown += new MouseButtonEventHandler(rect_Click); name.PreviewMouseDown += new MouseButtonEventHandler(rect_Click); //progGrid.PreviewMouseDown += new MouseButtonEventHandler(rect_Click); icon.MouseDown += new MouseButtonEventHandler(rect_Click); info.MouseDown += new MouseButtonEventHandler(rect_Click); category.PreviewMouseWheel += ctrl_PreviewMouseWheel; //progGrid.PreviewMouseWheel += ctrl_PreviewMouseWheel; }