Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void getphases()
- {
- foreach (var item in categoryList)
- {
- ListBox lb = new ListBox();
- // lb.SelectionChanged += lb_SelectionChanged;
- lb.Margin = new Thickness(0, 0, 0, 0);
- lb.Height = 550d;
- lb.Name = "InnerListBox";
- lb.PreviewMouseLeftButtonDown += lb_PreviewMouseLeftButtonDown;
- lb.AllowDrop = true;
- lb.GiveFeedback += lb_GiveFeedback;
- lb.DragEnter += lb_DragEnter;
- lb.Drop += lb_Drop;
- lb.DragOver += lb_DragOver;
- lb.BorderThickness = new Thickness(0, 0, 0, 0);
- BrushConverter bs = new BrushConverter();
- lb.Background = (Brush)bs.ConvertFromString("#FFF3800C");
- ListBoxItem lbi = new ListBoxItem();
- lbi.Margin = new Thickness(0, 0, 0, 0);
- }
- //this event is not firing
- void lb_DragEnter(object sender, DragEventArgs e)
- {
- if (_dragged == null || e.Data.GetDataPresent(DataFormats.Text, true) == false)
- e.Effects = DragDropEffects.None;
- else
- e.Effects = DragDropEffects.All;
- }
- //Drag&Drop not working
- void lb_DragOver(object sender, DragEventArgs e)
- {
- e.Effects = DragDropEffects.Copy;
- }
- <ListBox x:Name="icTodoList" local2:ProjectTabTavlaViewModel.ListBox="{Binding ElementName=icTodoList}" Background="#FFF3800C" Canvas.Top="25" Height="600" Width="{Binding ElementName=gd,Path=ActualWidth}" BorderThickness="0" BorderBrush="{x:Null}">
- <ListBox.Resources>
- <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FFF3800C" Opacity="0.2"/>
- <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="#FFF3800C" />
- </ListBox.Resources>
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel IsItemsHost="True" Orientation="Horizontal" />
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- </ListBox>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement